port install php5 fails on Leopard 10.5.4

Bill Hernandez ms at mac-specialist.com
Fri Jul 11 22:10:59 PDT 2008


On Jul 11, 2008, at 1:09 AM, Ken Tozier wrote:

>> /opt/local/apache2/conf/httpd.conf
>> should show the three items below :
>>
>> LoadModule php5_module modules/libphp5.so
>>
>> Include conf/mod_php.conf
>>
>> DocumentRoot "/Web/path/to/your/www"
>


Ken,

You will need to create the httpd.conf from a copy of either :
( a ) one you already have such as '/Library/WebServer/Documents/ 
httpd.conf', or
( b ) duplicate the one in the '/opt/local/apache2/conf/original/'  
folder :

You are probably better of with ( b ) and compare the contents to what  
exists in ( a )
-------------------------------------------------
These are the steps, but first read the explanation below :
-------------------------------------------------
( 1 ) $ curr_dir=pwd
( 2 ) $ sudo cp /opt/local/apache2/conf/original/httpd.conf /opt/local/ 
apache2/conf/httpd.conf
( 3 ) $ cd /opt/local/apache2/modules
( 4 ) $ sudo /opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so
( 5 ) $ cd $curr_dir

The instructions at the end of the PHP install show something similar  
to the comments below

NOTES FROM THE PHP INSTALL
# +---------+---------+---------+---------+---------+--------- 
+---------+---------+---------+---------+
# If this is your first install, you might want to do :
# cd /opt/local/apache2/modules
# sudo /opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so
# Password:
# ---> [activating module `php5' in /opt/local/apache2/conf/httpd.conf]
# +---------+---------+---------+---------+---------+--------- 
+---------+---------+---------+---------+

-------------------------------------------------
Explanation of the steps above
-------------------------------------------------
( 1 ) save the current directory to a variable
( 2 ) this step is used if you don't have an existing httpd.conf, i.e.  
this is your first install, not an upgrade of the port
( 3 ) this puts you in the correct directory to execute the next command
( 4 ) The command on line ( 4 )  will automatically add 'LoadModule  
php5_module modules/libphp5.so' to the httpd.conf.
        I believe it also adds 'Include conf/mod_php.conf', if not you  
can add that manually towards the bottom of httpd.conf
( 5 ) restore the current dir

When you open httpd.conf you can set DocumentRoot "/Web/path/to/your/ 
www" to the same path that the default apple installation sets, that  
way you won't have to move any of your html documents if you so desire.

i.e. DocumentRoot /Library/WebServer/Documents/

If you wish you can also compare the httpd.conf in '/Library/WebServer/ 
Documents/' to the new one you copied in step ( 2 ) above and see what  
small changes you need to make.

Whatever you do, don't give up. I was incredibly frustrated when I  
first started working with MacPorts because I didn't understand the  
hierarchy, but am extremely glad that I stuck with it.

Don't hesitate to ask for help. There are some really knowledgeable  
people on this forum that will pitch in to help...

Good Luck,

Bill Hernandez
Plano, Texas




More information about the macports-users mailing list