| View previous topic :: View next topic |
| Author |
Message |
denvertimothy
Joined: 29 Oct 2007 Posts: 4
|
Posted: Mon Oct 29, 2007 21:44 Post subject: Rolling own libphp5.so fails on Leopard |
|
|
I've documented my attempt to create my own PHP5 DSO on Leopard because the included one doesn't support PostgreSQL. You can see here:
http://reduxcomputing.com/leopard-php5.html
I can get it compile fine, but when apache loads it, it results in some kind of "architecture" problem. Is anybody familiar with this problem?
Depending on how it compiles, the error varies. Here's the key excerpts from the write so you know if you're looking at the same thing:
Syntax error on line 114 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/libphp5.so into server: dlopen(/usr/libexec/apache2/libphp5.so, 10): no suitable image found. Did find:\n\t/usr/libexec/apache2/libphp5.so: no matching architecture in universal wrapper
Syntax error on line 114 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/libphp5.so into server: dlopen(/usr/libexec/apache2/libphp5.so, 10): no suitable image found. Did find:\n\t/usr/libexec/apache2/libphp5.so: mach-o, but wrong architecture |
|
| Back to top |
|
 |
mickey79
Joined: 31 Jul 2007 Posts: 40
|
Posted: Mon Oct 29, 2007 21:54 Post subject: |
|
|
| In my quest for finding a solution to my problem - I came across the exact same problem you've mention and it's solution on some other forum. Let me look it up - I can't remember where I saw it, but I saw somebody talking about it . |
|
| Back to top |
|
 |
mickey79
Joined: 31 Jul 2007 Posts: 40
|
Posted: Mon Oct 29, 2007 21:59 Post subject: |
|
|
Alright found it!
This is the thread: http://discussions.apple.com/thread.jspa?messageID=5676677&tstart=0
This is the post from someone who had a similar problem:
Recompiling PHP would involve installing the Developer Tools off the Leopard DVD and downloading the PHP source from php.net.
I wouldn't quite recommend that yet as I have done that and have ended up in a worse situation than when I had started. Basically I downloaded the GD library, libjpeg, libpng libraries, got those installed. Then got the PHP source unzipped and configured with:
./configure --with-zlib --with-jpeg-dir=/usr/local/bin --with-png-dir=/usr/local/bin --with-gd --with-mysql=/usr/local/mysql --with-libxml-dir=/usr/local/lib/python2.5/site-packages --with-curl --with-apxs2
Compiled and installed, but Apache was no longer able to start with the PHP5 module. The error that comes back when I try to start Apache is:
httpd: Syntax error on line 114 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/libphp5.so into server: dlopen(/usr/libexec/apache2/libphp5.so, 10): no suitable image found. Did find:\n\t/usr/libexec/apache2/libphp5.so: mach-o, but wrong architecture
I'm wondering if PHP is being built in 32bit but Apache in Leopard is 64bit. I can't seem to find any information on this problem.
~~~~~~~~~~~~~~~~~~~
Solution has been found!
The same thing here - after building PHP from source, i get the same error message: Cannot load /usr/libexec/apache2/libphp5.so into server: dlopen(/usr/libexec/apache2/libphp5.so, 10): no suitable image found. Did find:\n\t/usr/libexec/apache2/libphp5.so: mach-o, but wrong architecture
I've been able to eliminate the whole problem by recompiling Apache2 from source:
./configure --enable-layout=Darwin --enable-mods-shared=all
make
make install
It's even not necessary to rebuild PHP after that. Just relaunch web sharing in System Preferences > Sharing
I think the problem was in apxs2, which was, i suppose, compiled in universal binary format as shipped in Leopard. |
|
| Back to top |
|
 |
denvertimothy
Joined: 29 Oct 2007 Posts: 4
|
Posted: Thu Nov 01, 2007 7:33 Post subject: |
|
|
Indeed, it does work! Good enough for now. Been working like this for about 4 days now. Seems to be no side effects. However, I will be interested to see what comes of this, because this way doesn't seem to be ultimate best solution.
| mickey79 wrote: |
./configure --enable-layout=Darwin --enable-mods-shared=all
make
make install
It's even not necessary to rebuild PHP after that. Just relaunch web sharing in System Preferences > Sharing
|
Although, I did use my custom PHP DSO because I needed Postgres support. |
|
| Back to top |
|
 |
ebi

Joined: 31 Oct 2007 Posts: 4 Location: Züri
|
Posted: Thu Nov 01, 2007 13:01 Post subject: Re: Rolling own libphp5.so fails on Leopard |
|
|
| denvertimothy wrote: | | I can get it compile fine, but when apache loads it, it results in some kind of "architecture" problem. Is anybody familiar with this problem? |
| mickey79 wrote: | | I'm wondering if PHP is being built in 32bit but Apache in Leopard is 64bit. I can't seem to find any information on this problem. |
That seems to be the case and is somehow solved See http://www.entropy.ch/phpbb2/viewtopic.php?p=10861#10861 |
|
| Back to top |
|
 |
vielinko
Joined: 08 Sep 2008 Posts: 4
|
Posted: Fri Sep 19, 2008 21:10 Post subject: |
|
|
| Quote: |
Solution has been found!
The same thing here - after building PHP from source, i get the same error message: Cannot load /usr/libexec/apache2/libphp5.so into server: dlopen(/usr/libexec/apache2/libphp5.so, 10): no suitable image found. Did find:\n\t/usr/libexec/apache2/libphp5.so: mach-o, but wrong architecture
I've been able to eliminate the whole problem by recompiling Apache2 from source:
./configure --enable-layout=Darwin --enable-mods-shared=all
make
make install
|
Hello, I know that i'm posting out of date ... but this forum help me too much to solve 1 of 2 problems.
The quote's message really help me, because my apache (httpd) didnt startup when I tried to use PHP5 module. After recompile it, works fine ... btw, I have Leopard (10.5.4) and need to practice PHP because my homeworks ...
The 2nd problem that i had, was my MySQL ODBC Connector for Leopard, from mysql site, the last release works fine on Tiger (10.4.*) ... i tried to recompile the mysql connector' source to Tiger into Leopard ... but didnt works ... I just doesn't use ODBC anymore for mysql connection ... I still finding a Free alternative, because I just need it to do my homework ....
rgds
Viel.
p.s. Omg! it's my first post in here ... |
|
| Back to top |
|
 |
fazthegreat
Joined: 15 Apr 2009 Posts: 2
|
|
| Back to top |
|
 |
vielinko
Joined: 08 Sep 2008 Posts: 4
|
Posted: Thu Jun 04, 2009 18:17 Post subject: |
|
|
| fazthegreat wrote: | | I'm having some problems with my installation, wish this forum was a bit more active. A few posts I found were a great help. |
Post your problem, maybe someone can help you ... don't be shine  |
|
| Back to top |
|
 |
Dionnah
Joined: 15 Aug 2009 Posts: 2
|
Posted: Sat Aug 15, 2009 14:21 Post subject: |
|
|
" Don't be shine". LoL!
I can help you with that Fazthegreat. Please send a PM and I will guide you how to do it.
Pret immobilier |
|
| Back to top |
|
 |
vielinko
Joined: 08 Sep 2008 Posts: 4
|
Posted: Tue Aug 18, 2009 5:50 Post subject: |
|
|
| Dionnah wrote: | " Don't be shine". LoL!
I can help you with that Fazthegreat. Please send a PM and I will guide you how to do it.
Pret immobilier |
Hello .... I think that you most share your tips with all ppl that needs it ... Usually The post solutions can help ... |
|
| Back to top |
|
 |
vielinko
Joined: 08 Sep 2008 Posts: 4
|
Posted: Tue Aug 18, 2009 5:55 Post subject: |
|
|
| vielinko wrote: |
The 2nd problem that i had, was my MySQL ODBC Connector for Leopard, from mysql site, the last release works fine on Tiger (10.4.*) ... i tried to recompile the mysql connector' source to Tiger into Leopard ... but didnt works ... I just doesn't use ODBC anymore for mysql connection ... I still finding a Free alternative, because I just need it to do my homework ....
|
Btw ... Finally, I didnt use ODBC for my PHP connections. Just use something like that
| Code: |
con = mysql_connect('127.0.0.1:3306', 'root', '') or die('Error: Cannot connect to MySQL');
|
maybe someone find useful. |
|
| Back to top |
|
 |
josephla
Joined: 05 Oct 2009 Posts: 1
|
Posted: Mon Oct 05, 2009 18:59 Post subject: |
|
|
hi,
i'm wondering if the solution from mickey79 in oct 2007 still holds for this error on darwin? i only need to recompile apache2 and it should clear the error?
tia,
joey |
|
| Back to top |
|
 |
|