INLS 183
Distributed systems & analysis
  Project Directions | Project 1 | Project 2 | Project 3 |  | Project 5 | Project 6 | Project 7 | Project 8 | Project 9 | Project 10 |

Home > Project 4 • IntroductionNarrativeInstructionsFunctionalityExtras

Introduction

For this project I installed PHP 4 on my previously installed Apache server. I wanted to do this so that I can possibly play around with some PHP this semester.

I originally wanted to install PHP last week, but installed lynx instead because I was tired of not being able to surf the Web through the Linux box. I wanted to do at least one more Apache related installation and PHP seemed the logical choice since I want to try some PHP this semester.
Narrative

I started this project by going to php.org to read up on PHP and what an install would likely entail. Php.org was some commercial site but it did have a nice link to php.net, the homepage of PHP.

Once I made it to the correct site, I read up on PHP and its history, and a little bit about what I can do with PHP. I also read up on what I would need to install depending on what I wanted to do with PHP (link). I decided that I wanted to primarily use PHP for server-side includes and maybe client side GUI applications.

After reading up, I found some pages with installation directions and advice from other people who had installed PHP in a variety of ways and on a number of operating systems (link). I read over some of the posts before going to the download page on the PHP website. I found a mirror site and downloaded the tar ball.

After downloading, I moved the tar ball into a new directory and unzipped it. I read the install files for any steps I needed to take to install the necessary files. I checked to make sure that the required files were also present on the Linux box.

After finding all the required files I went ahead and tried to configure PHP using the command './configure -- mysql --apxs'. At this point I got an error saying that apxs could not be found. I used 'locate apxs' to find some files and determine one that I could use as an absolute path. I found several, but in the general /usr/bin directory and in group members' directories, and decided to choose the default for the box.

 

APXS Problem message - no absolute path

checking for Apache 1.x module support via DSO through APXS...
Sorry, I was not able to successfully run APXS. Possible reasons:
1. Perl is not installed;
2. Apache was not compiled with DSO support (--enable-module=so);
3. 'apxs' is not in your path. Try to use --with-apxs=/path/to/apxs
The output of apxs follows
./configure: apxs: command not found
configure: error: Aborting

APXS Problem message - Incorrect apsx version

problem message - checking for AOLserver support... no
checking for Apache 1.x module support via DSO through APXS... configure: error: Use --with-apxs2 with Apache 2.x!


After using an absolute path I thought everything would work, but I got another error, this time saying that I needed to use 'apxs2' with Apache 2.x versions. I found no 'apxs2' files on the Linux box nor in any help sections on the PHP website. After searching the Web with Google, I finally found a random article and discovered that Ineeded to reword my command, which was just like the error message said! Stare at something long enough...

Now with the correct syntax in my configure command and the absolute path, PHP finally configured correctly on the computer. Next I typed 'make' and 'sudo make install' with no problems, I then edited the settings for 'php.ini-dist' but decided not to change anything, and moved a copy of it to '/usr/local/lib/php.ini'.

I then edited my 'httpd.conf' file in my Apache folders to accept the new MIME types for PHP. Then I made a test page with a simple PHP echo command and went to restart my server. At this point, I got the same message I had seen two weeks previous, where for some reason I could not stop or start my server. Since other people in my group were working on the group box I could not simply reboot the whole system.
Instructions for use

PHP works automatically in the background from the server. I set the MIME to recognize pages with .php and .phtml extensions as php, so any page with such an extension should display PHP fine.
Functionality

I think my PHP installation works, but I need to do some fine tuning. When browsing in Mozilla to a test page with a '.php' or a '.phtml' extension, Mozilla only wanted to download the file. Maybe I need to look at my conf file again, as I got the same issue with OmniWeb and Internet Explorer as well... I haven't figured this out yet however.

I am still trying to set my httpd.conf file correctly so that php pages load correctly. I have followed all the directions and the faq but php pages that I put up are served as downloads when I try to view them.

I would have restarted the computer to force my server to restart but Joel was doing a late night project on our box and was afraid that if I rebooted the computer it may not start back up for some reason. So I am waiting to restart the box.
Files and Baubles

Installation Script
• Could not generate any screen shots at this time


   


  If you have any questions or issues, you can contact me at MCarroll at email.unc.edu.