Installation

only for RuBoard - do not distribute or recompile

Installation

You now have installed all the packages necessary for building PHP from source. I will lead you through a step by step build and install of the PHP package, with the options necessary for this project.

NOTE

Under RedHat 6.1, a bug is introduced with the Apache server. You must either install the updated Apache RPM files, version 1.3.9.8 or later, included on the CD-ROM, or you must edit an Apache configuration file.

If you cannot update the Apache RPM's, then edit the /usr/sbin/apxs file. Around line 81 you will see a line similar to the following:

 my $CFG_LIBEXECDIR = 'modules';           # substituted via APACI install 

Change the line to read

 my $CFG_LIBEXECDIR = '/usr/lib/apache';   # substituted via APACI install 

At around line 76, locate the line similar to the following:

 my $CFG_LDFLAGS_SHLIB = '-shared'; # substituted via Makefile.tmpl 

Change the line to read

 my $CFG_LDFLAGS_SHLIB = 'q(-shared)'; # substituted via Makefile.tmpl 

The next step is to untar the PHP directory. Change into the imp directory, and run the untar command:

 root@winbook imp]# tar xvzf php-3.0.15.tar.gz 

This will create the php-3.0.15 directory. Change to it, and run the configure command as follows :

 [root@winbook imp]# cd php-3.0.15 [root@winbook php-3.0.15]# ./configure --with-apxs --with-xml --with-mysql=/usr --with-imap 

NOTE

The latest release of PHP compiles MySQL as a default. However, the installation documentation is misleading. It tells you to put the path to MySQL after --with-mysql. That will cause the compile to fail if you read it like I did. Instead, use the --with-mysql=/usr command line.


The configure script will start printing the checks it is making. This will take a few minutes. Next, run the make command:

 [root@winbook php-3.0.15]# make 

This can take several minutes. When make is finished, run the install command:

 [root@winbook php-3.0.15]# make install 

You should see a printout similar to this:

 apxs -i -a -n php3 libphp3.so cp libphp3.so /usr/lib/apache/libphp3.so chmod 755 /usr/lib/apache/libphp3.so [activating module `php3' in /etc/httpd/conf/httpd.conf] 

The last line of the printout tells you that the install script modified the Apache httpd.conf file. Now Apache will load the PHP module when needed. Copy the default ini file to /usr/local/lib, and then restart the Web server:

 [root@winbook php-3.0.15]# cp php3.ini-dist /usr/local/lib/php3.ini [root@winbook php-3.0.15]# /etc/rc.d/init.d/httpd restart Shutting down http:                                        [  OK  ]  Starting httpd:                                            [  OK  ] 

Now you must check to see if the Apache Web server is running. Use the ps ax command, pipe through grep, looking for httpd:

 [root@winbook root]# ps ax  grep httpd   514 ?        S      0:00 httpd   518 ?        S      0:00 httpd   519 ?        S      0:00 httpd   520 ?        S      0:00 httpd   521 ?        S      0:00 httpd   522 ?        S      0:00 httpd   523 ?        S      0:00 httpd   524 ?        S      0:00 httpd   525 ?        S      0:00 httpd 813 pts/1    S      0:00 grep httpd 

You should see something like the previous printout. If you don't, read the "Troubleshooting the Installation" section in Chapter 4, "Apache Web Server."

You now have PHP correctly installed with the Apache Web server. You will want to read the section "Apache Web Server." That section describes a configuration file change to allow Apache to use PHP files as main index pages. Now would be a good time to skip back to Chapter 4, to the section titled "Testing the PHP and IMP Configuration."

only for RuBoard - do not distribute or recompile


MySQL and PHP From Scratch
MySQL & PHP From Scratch
ISBN: 0789724405
EAN: 2147483647
Year: 1999
Pages: 93
Authors: Wade Maxfield

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net