Apache + PHP5 Help

Ryan Schmidt ryandesign at macports.org
Mon Oct 29 16:36:41 PDT 2007


On Oct 29, 2007, at 18:28, Ronald Valente wrote:

> On Oct 29, 2007, at 5:16 PM, Ryan Schmidt wrote:
>
>> On Oct 29, 2007, at 11:49, Ronald Valente wrote:
>>
>>> I am on Leopard Server with MacPorts that I compiled from source.
>>
>> Note that since Leopard is still very new and most MacPorts  
>> contributors do not have it yet, you may run into more than your  
>> fair share of problems. If you do, please report them to us so  
>> that we can get them resolved.
>
> Where is the correct place to report bugs?

Our Trac issue tracker. Instructions for filing bugs are here:

http://trac.macosforge.org/projects/macports/wiki/TracTicketing


>>> I ran the following command:
>>>
>>> sudo port install php5 +mysql5 +server +macosx +snmp +apache2
>>
>> The php5 port has no variant "+server". If you intended to get a  
>> MySQL server running on this computer (the mysql5 port has a  
>> +server variant), you would have needed:
>>
>> sudo port install mysql5 +server
>> sudo port isntall php5 +mysql5 +snmp +apache2
>>
>> Also, although it does no harm to specify it yourself, you never  
>> need to say "+macosx" on Mac OS X; it is auto-selected for you.
>
> It seems as though I need to specify +apache2 to use apache2.

That's true.


> I have done much work today on this setup with little to show for it.
> I have come to the following conclusion and will be trying this on  
> my laptop tonight (unfortunately) because I have no access to the  
> server at work from home.
>
> sudo port install mysql5 +server
> sudo port install apache2 +workermpm
> sudo port install php5 +mysql5 +snmp +apach2
> sudo port install nagios
> sudo port install cacti +server
> sudo port install nedi +server
> sudo port install rancid
>
> In all fairness my main problem is not nagios or apache2 now it is  
> completely with rrdtool and cacti not displaying graphs at all.
> So that would be my main goal right now is to get that working.
>
>
>>> Then I pointed my httpd.conf to the /opt/local/apache2/modules/ 
>>> libphp5.so and phpinfo shows the new version.
>>> PHP Works but I do not see anypictures. It is compiled with GD  
>>> and libpng support but I get a question mark where every png  
>>> should be.
>>>
>>> For more clarification I am trying to use NetMRG or Cacti.
>>> All my permissions are correct.
>>>
>>> Here is the error I get when I checked the log.
>>>
>>> 10/29/07 8:54:49 AM org.apache.httpd[35339] httpd: Syntax error  
>>> on line 143 of /private/etc/apache2/httpd.conf: Cannot load /opt/ 
>>> local/apache2/modules/libphp5.so into server: dlopen(/opt/local/ 
>>> apache2/modules/libphp5.so, 10): no suitable image found.  Did  
>>> find:\n\t/opt/local/apache2/modules/libphp5.so: mach-o, but wrong  
>>> architecture
>>>
>>> Thanks in advance!
>>
>> This seems contradictory. Either PHP works (and you would not get  
>> the syntax error relating to the httpd.conf), or you are getting a  
>> syntax error about the httpd.conf (in which case PHP cannot be  
>> working).
>>
>> If you see broken images within your HTML pages, view just the  
>> image by itself to see what the real error message is. For  
>> example, in Firefox or Camino, Control-click the image and select  
>> View Image. In Safari, Control-click the image and select Open  
>> Image in New Window.
>>
>> I wonder why Apache thinks the PHP module is for the wrong  
>> architecture. What architecture is your computer? (Intel or  
>> PowerPC?) What architecture is the library? (Type "file /opt/local/ 
>> apache2/modules/libphp5.so" in the Terminal.) Did you recently  
>> change from one architecture to another, and use Migration  
>> Assistant or some other means to transfer a MacPorts installation  
>> from the old machine to the new one? If so, that could account for  
>> this, and the solution would be to delete all of MacPorts per the  
>> instructions in the FAQ and reinstall MacPorts.
>
> The problem here was that I was pointing to the httpd in /usr/sbin  
> and not /opt/local/apache2/bin so the libphp5.so was compiled for  
> apache 2.2.6 and not the built in 2.2.4 which was actually running.

Ah, I see.


Don't forget to Reply To All when you reply so your reply goes to the  
list too, not just to me.



More information about the macports-dev mailing list