PHP/Apache/phpMyAdmin dependencies (was: Re: interspersed and cut off)

Ryan Schmidt ryandesign at macports.org
Tue Jun 12 16:21:22 PDT 2007


On Jun 12, 2007, at 14:41, Pete Gontier wrote:

> On Jun 11, 2007, at 8:47 PM, Pete Gontier wrote:
>
>> Right now, I'm scratching my head trying to figure out what good  
>> MySQL is without it being a server. Maybe that's what I want and I  
>> just don't understand exactly what "+server" implies. I'm probably  
>> going to install phpMySQL and see if I can get all these packages  
>> talking to each other on the same system, and if so then skipping  
>> "+server" was the right thing to do.
>
> Did I say phpMySQL? I meant phpMyAdmin.

We understood what you meant. :)

> Here's my latest sob story:
>
> I installed php5, and it worked well enough for the "phpinfo"  
> function to spew its usual census. It seems notable that although I  
> specified variant "+apache", the build did not seem to depend on  
> MacPort's Apache. This was fine with me, as I was happy to use  
> Apple's Apache, as this would save me time. And once php5 was  
> built, this is what I did. As I said, it seemed to work fine.

Correct. "php5 +apache" currently uses Apple's Apache. This is  
inconsistent with MacPorts general policy and I will change it,  
eventually, so that +apache will use MacPorts Apache 1, and a new  
variant +apache_apple will use Apple's Apache.

> Then I installed phpMyAdmin, which did depend on MacPort's Apache.  
> It seemed odd that phpMyAdmin triggered this while php5 with  
> "+apache" did not. But that's fine; at the expense of some disk  
> space and a bit less integration with System Preferences, I get a  
> slightly newer Apache, right?

I removed this from the phpmyadmin port yesterday. There's no reason  
why phpmyadmin (or any other web app) should be written to depend on  
any particular web server. (phpMyAdmin works perfectly well with  
lighttpd, too, for example.) "sudo port sync" to get the latest  
version of the phpmyadmin portfile which no longer depends on any  
specific web server port.

> Then the fun started. PHP stopped working. Having built MacPorts'  
> Apache, turned off Apple's Apache, told MacPorts' Apache where to  
> find PHP, and restarted to test the startup item MacPorts told me  
> it created, "apachectl configtest" then told me "libphp5.so is  
> garbled - perhaps this is not an Apache module DSO?" Hmmm. I didn't  
> touch it and now it's garbled? Odd.

You built php5 for Apple's Apache, and are now trying to use it with  
MacPorts Apache. Yes, that will not work. Built php5 for the version  
of Apache you want to use it with.

> I hatched some wacky theories involving install sequence and  
> conflicts with Apple's Apache, but they didn't bear any fruit. So I  
> started from scratch: nuked everything from orbit, then tried to  
> sequence things carefully: Apache first, then MySQL, and then PHP.  
> Here's what 'port installed' says:
>
>>   apache @1.3.37_0 (active)
>>   curl @7.16.2_0 (active)
>>   expat @2.0.1_0 (active)
>>   freetype @2.3.4_1 (active)
>>   gettext @0.16.1_0 (active)
>>   gperf @3.0.3_0 (active)
>>   jpeg @6b_1 (active)
>>   libiconv @1.11_4+darwin_7 (active)
>>   libmcrypt @2.5.8_0 (active)
>>   libpng @1.2.18_0 (active)
>>   libxml2 @2.6.28_1 (active)
>>   libxslt @1.1.20_0 (active)
>>   mhash @0.9.9_0 (active)
>>   mysql5 @5.0.41_0+server (active)
>>   openssl @0.9.8e_0 (active)
>>   pcre @7.1_1+utf8 (active)
>>   php5 @5.2.3_0+apache+darwin_7+macosx+mysql5+pear (active)
>>   pkgconfig @0.21_0 (active)
>>   tiff @3.8.2_0 (active)
>>   zlib @1.2.3_1 (active)
>
> Looks good to me. Sadly, I'm still getting this:
>
>> $ sudo apachectl configtest
>> Syntax error on line 237 of /opt/local/etc/apache/httpd.conf:
>> API module structure `php5_module' in file /opt/local/libexec/ 
>> apache/libphp5.so is garbled - perhaps this is not an Apache  
>> module DSO?
>
> Ouch. Why did it work before where it refuses to work now?  
> Obviously, I've done something different, but I'm at a loss to  
> guess what.

The php5 module was built for Apple's Apache but you're trying to use  
it with the MacPorts Apache.

Looks like I should really get a move on and fix the php5 +apache  
variant to do what we say in the FAQ we do -- which is, use MacPorts  
software, not Apple software, by default, unless there's a good  
reason not to.






More information about the macports-users mailing list