Apache + PHP5 Help

Ryan Schmidt ryandesign at macports.org
Mon Oct 29 14:16:20 PDT 2007


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.


> 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.


> 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.



More information about the macports-dev mailing list