|
1. Log into your computer as root (or
Administrator - same diff)
|
|
|
2. Open Terminal.app from the Apple Menu
|
|
|
3. Change to the root folder of your
MacOS X Server boot volume
|
cd /
|
|
4. Try to change to /usr/local/src/
|
cd /usr/local/src/
|
|
If it doesn't exist,
create it, and move to the new folder
|
mkdir /usr/local/src
cd /usr/local/src
|
|
5. Switch back to OmniWeb, and download the
Zend source code.
|
Hold down the Apple key and single click on the
link below.
PHP source
package
You will get a file dialog. Change the directory
to /usr/local/src/ and download the file to
this directory.
|
|
6. You will also have to download the most
recent released source code tarball of the Apache
webserver. To do this:
|
Go to the Apache website, and download
download the file to this directory.
|
|
7. Now we will decode these files by hand. To do
this:
|
Type:
cd /usr/local/src
tar xzf php-4.0b1.tar.gz
tar xzf apache_1.3.6.tar.gz
Then type:
rm php-4.0b1.tar.gz
rm apache_1.3.6.tar.gz
|
|
9. Change to the Apache source directory
|
cd apache_1.3.6
|
|
10. Configure the install program so that it
will install in /opt/apache
|
./configure
--prefix=/opt/apache
|
|
11. Change back to the PHP folder
|
cd ../PHP-4.0b1
|
|
12. Run the setup program
|
./setup
|
|
13. The application will ask you a number of
questions. Unless you know that you have some of
the libraries mentioned in the installation, do not
install unnecessary functionality of your CGI
module may not compile. Follow the following
recommendations:
|
Accept all the choices of the setup
applications, except for the following: (you can
override our recommendations if you know that you
have the necessary libraries:
- GD Support - no
- Default config directory - yes
Enter Configuration file directory - accept
default
- Compile with debug information -
no
- Enable variable tracking by default -
yes (can be changed, automatically
creates arrays of form variables)
- Enable magic quotes by default - yes
(escapes " characters in forms)
- Enable redirect checking - yes
- Enable discard path - yes
|
|
14. The setup application will scroll by a whole
bunch of stuff. You don't have to do anything. Do
not stop this, however, of you will have to start
again.
|
|
|
15. When this is done, type make
|
make
|
|
16. Assuming that went through, type make
install
|
make install
|
|
17. Copy the initialization file to /usr/local/lib
If this folder doesn't exist, create it.
|
cp php.ini-dist /usr/local/lib
If error:
mkdir /usr/local/lib
cp php.ini-dist /usr/local/lib/php.ini
|
|
18. Change back to the Apache folder
|
cd ../apache_1.3.6
|
|
19. Configure Apache by...
Note: You need not use /opt/apache - it's just a
personal choice. You can use whatever directory you
wish to use
|
./configure --prefix=/opt/apache --activate-module=src/modules/php4/libphp4.a
|
|
20. Type make
|
make
|
|
21. (We will assume you have not installed another version of Apache after installing the OS)
Install Apache where you wanted it
|
make install
|
|
22. You will have to edit the configuration file for Apache before you can use it.
|
Open the configuration file
pico
/opt/apache/conf/httpd.conf
Change the following sections to:
Line 246/247 - change the user and group to www (optional, but better than nobody)
Line 254 - Change the ServerAdmin to your email address
Line 269 - make sure the ServerName is set to the domain name or IP address for your computer, or you will get an error message from apachectl that your configuration file is configured incorrectly.
Line 277 - Set the document root to whatever you want to be the home directory to all your stored files. It will most likely be set by default to /opt/apache/htdocs, but you can change it to whatever you want. Remember, though,
that it will have to be a real directory to function properly. DocumentRoot "/opt/apache/htdocs" Line 302 - Change the line which looks like this: <Directory "*something*"> to <Directory "/opt/apache/htdocs"> or to where your document root is. This must be the same as the directory you indicated above. Line 354 - You may want to add some more directory indices
for Apache. These are the names of the files apache looks for in a directory.
You should probably add index.php and index.phtml to index.html, so that your line would look like: DirectoryIndex index.html index.php index.phtml Lines 654/655 - Uncomment these two lines. These ar
e the files that apache will consider php programs to run. You can have more than one, and if you want all files parsed (not recommended unless all your pages are php scripts) you can add .html on there. I usually set it up like
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
If you don't know, .phps files are PHP source files. All files which end in .phps are output by PHP unexecuted and instead syntax highlighted.
|
| 23. Save the configuration file |
If you're using pico, then type:
Control-X
answer 'y'
hit return
|
| 24. Start your new version of Apache |
/opt/apache/bin/apachectl start |
| 25. Create a new file called helloworld.php in your document root, and include the line <? phpinfo(); ?> inside of this file, and then point your web broswer to http://localhost/hell
oworld.php and you should see a wealth of information about your PHP4 set-up, including all the pretty Zend logos. :) |