note 7972 added to Installation on UNIX systems
| From: | Unknown Sender | Date: | Tue, 22 Aug 2000 23:22:29 +0000 |
| Subject: | note 7972 added to Installation on UNIX systems | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-2938@lists.php.net to get a copy of this message | ||
OS X Server Install
What I did was run PHP4 directly into my Apache build, ie. a static module. First thing, get the
latest distributions of each; 1.3.12 for Apache and 4.0.1pl2 for PHP. Untar them, and run the
configure program on Apache like so. I've set my apache up to replace the one that came with OS
X Server. If you've got yours elsewhere, you'll
probably want to change the directories:
./configure --exec-prefix=/usr \
--localstatedir=/var \
--mandir=/usr/share/man \
--libexecdir=/System/Library/Apache/Modules \
--iconsdir=/System/Library/Apache/Icons \
--includedir=/System/Library/Frameworks/Apache.framework/Versions/1.3/Headers \
--enable-shared=max \
--enable-module=most \
--target=apache
You may also want to add this line:
setenv OPTIM=-O2
If you want the compiler to do some optimization. I've done it successfully at O2 for both
Apache and PHP. I wouldn't recommend going any higher, seeing as how Apache recommends against
it. Next, go to the php4 source directory and configure it. Here's what I did:
./configure --prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/share/man \
--with-xml \
--with-apache=/src/apache_1.3.12
If you have any other addiitons (MySQL, GD, etc.), be sure to add them here. For the
--with-apache string, put in the path to your
apache source directory. Mine's at "/src/apache_1.3.12". If all goes well, go ahead
and make, then make install. This will add a directory to your Apache source directory under
src/modules/php4. Now, we need to reconfigure Apache to build in PHP4. Here's my settings:
./configure --exec-prefix=/usr \
--localstatedir=/var \
--mandir=/usr/share/man \
--libexecdir=/System/Library/Apache/Modules \
--iconsdir=/System/Library/Apache/Icons \
--includedir=/System/Library/Frameworks/Apache.framework/Versions/1.3/Headers \
--enable-shared=max \
--enable-module=most \
--target=apache \
--activate-module=src/modules/php4/libphp4.a
You may get a message telling you that libmodphp4.a is out of date. If so, go to the
src/modules/php4 directory inside your apache source directory and run this command:
ranlib libmodphp4.a
Then go back to the root of the apache source directory and run the above configure command
again. That'll bring the link table up to date. How it got out of date in those few scant
moments is beyond me. :-)
That should pretty much do it. Run make, then make install, and you should be laughing. Go into
your apache.conf and make the necessary
modifications, then run apache. To test to see if PHP4 is working, make a simple HTML document with
this in the body:
<? phpinfo() ?>
Name it something like test.php and look at it in your web browser.
If you get a page with more information than you ever wanted to know about your particular PHP
installation, then you're golden.
One more thing. Be sure to copy and rename the php.ini-dist file to your "bin"
directory from your php4 source directory:
cp php.ini-dist /usr/local/bin/php.ini
or (if your don't have a local directory)
cp php.ini-dist /usr/bin/php.ini
That's it! Hope it works as well for you as it did for me.
TTFN, James
http://www.php.net/manual/install-unix.php