port install php5 fails on Leopard 10.5.4

Ryan Schmidt ryandesign at macports.org
Fri Jul 11 01:12:24 PDT 2008


On Jul 11, 2008, at 01:09, Ken Tozier wrote:

> On Jul 10, 2008, at 10:49 PM, Bill Hernandez 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"
>
> That must be part of the problem. /opt/local/apache2/conf/httpd.conf
> doesn't exist /opt/local/apache2/conf/httpd.conf.example does but the
> string "php" doesn't appear anywhere in it. There is an httpd.conf
> file one level deeper in the hierarchy (/opt/local/apache2/conf/
> original/httpd.conf") but that doesn't contain "php" either.

Naturally. The apache2 port provides a sample configuration file that  
you can base your own real configuration file on. PHP is not  
mentioned in the example file because not all Apache users are PHP  
users. If you want PHP support, you add it to your configuration file.

> Another
> possible problem is that while both "httpd.conf.example" and "/
> original/httpd.conf" contain t"DocumentRoot" the path points to "/opt/
> local/apache2/htdocs" which, if I'm understanding how the "web
> sharing" checkbox works in the "Sharing prefs panel," puts it
> completely out of the normal web hosting framework.

Of course. MacPorts deliberately is a separate environment from what  
Apple provides, with respect to Apache and PHP and everything else.

But it's your configuration file, so you can define your DocumentRoot  
to be anything you want. You can point it back at /Library/WebServer/ 
Documents or wherever Apple has them in Leopard, or if you're  
developing in your Sites directory in your home directory then you  
can forget about the DocumentRoot and just use the user directory  
feature and access http://localhost/~yourname/

> This is starting to get complicated... Do I really have to subvert
> the nice simple turn it on/turn it off mechanism of web sharing and
> hand tool a bunch of settings to get this to work?

Web Sharing is for Apple's Apache server and is not applicable to the  
MacPorts Apache servers. Daemons in MacPorts are controlled using  
launchd. You can execute the launchd commands on the command line to  
start and stop these daemons, or you can install a GUI like Lingon to  
give you a prettier interface to do it.

> Or is the php Mac port not quite ready for prime time?

I maintain the php ports in MacPorts and consider them completely  
usable. There are some outstanding issues which you can read about by  
searching the issue tracker for "php". If you have any suggestions  
for improving the ports please contact me or the list or file a ticket.




More information about the macports-users mailing list