Install newest PHP ( 5.2.6 ) on Leopard - with "Leopard" Apache installation.

started at 15 Jun 2008 by Whisller
  • Whisller
    15 Jun 2008

    Hi,
    I have a fresh version of Leopard - just reinstalled. And I'm tried to install PHP ( I must recompile it because I must add support for PostgreSQL ).
    So I tried install it on apache which is installed default by Leopard ( configuration is good etc. so why don't use it :) ), but it was first mistake ;p
    After sudo make install and trying to restart apache it return an critical error.

    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

    Huh and what now, I say to myself. But google show me the small information. And I found that Apache from Leopard is on 64-bit architecture.
    I checked it by httpd -V, and it is true

    Server version: Apache/2.2.6 (Unix)
    Architecture: 64-bit

    So I tried to use CFLAGS='-arch x86_64' before ./configure, but after It I cannot do make because it crash all the time :/
    I try to remove all PHP files.

    Maybe you also saw this error?
    I will be glad if someone will help me.

  • Richard
    15 Jun 2008

    Hi, have you read: http://diymacserver.com/installing-php/installing-php-on-leopard-using-the-default-apache-installation/

    That is if you are using the default Apache install, which isn't quit clear to me.

    Can you please post your ./configure command ?

  • Whisller
    15 Jun 2008

    Yes, I have read it.

    My ./configure command:

    ./configure \
    --prefix=/usr \
    --mandir=/usr/share/man \
    --infodir=/usr/share/info \
    --with-apxs2=/usr/sbin/apxs \
    --with-config-file-path=/etc \
    --with-ldap=/usr \
    --with-kerberos=/usr \
    --sysconfdir=/private/etc \
    --enable-cli \
    --with-zlib-dir=/usr \
    --enable-exif \
    --enable-ftp \
    --enable-mbstring \
    --enable-mbregex \
    --enable-sockets \
    --enable-zip \
    --enable-soap \
    --enable-bcmath \
    --enable-calendar \
    --with-iodbc=/usr \
    --with-curl=/usr \
    --with-openssl \
    --with-xmlrpc \
    --with-xsl=/usr \
    --with-pgsql=/usr/local/pgsql \
    --with-pdo-pgsql=/usr/local/pgsql \
    --without-sqlite \
    --without-pear \
    --disable-short-tags

    And using it with Leopard apache I got error about incorrect architecture :/

    EDIT:
    Maybe only one solution is recompile apache using other architecture :/

  • Richard
    15 Jun 2008

    There is no problem with 64 bit or other architecture if you compile it accirding to my earlier setup. How did you compile postgresql ?

    What you could do is start with a minimum set of extra stuff compiled in and add more and more options to see where it might go wrong.

    So first no SSL, postgresql, curl, calender, bcmath, etc and try to get that to work. Then add one component at a time.

    Good luck and please post your working ./configure for other people.

  • Whisller
    15 Jun 2008

    I compiled postgresql using this article http://blog.whisnet.pl/wp-content/uploads/2008/06/pg_install.pdf

    How I installed it earlier? I just install another instance of apache :) Using your article. But I crashed something so I decide to reinstall it using Leopard Apache.

    But as I said Leopard Apache is in 64-bit - only this information I found about this problem.

    I will try to compile it without curl etc. And if it will not work, I can only re-compile apache :(

    Ok i will try and write progress :)

  • Whisller
    15 Jun 2008

    SOLUTION:
    1. First I downloaded latest snapshot version of PHP 5.3 ( tomorrow I will check how it works with 5.2.6 stable )
    2. Before ./configure add "CFLAGS="-arch x86_64" \"
    3. And it is all :) On my localhost it works good

    So now my whole ./configure file looks that
    CFLAGS="-arch x86_64" \
    ./configure \
    --prefix=/usr \
    --mandir=/usr/share/man \
    --infodir=/usr/share/info \
    --with-apxs2=/usr/sbin/apxs \
    --with-config-file-path=/etc \
    --with-ldap=/usr \
    --with-kerberos=/usr \
    --sysconfdir=/private/etc \
    --enable-cli \
    --with-zlib-dir=/usr \
    --enable-exif \
    --enable-ftp \
    --enable-mbstring \
    --enable-mbregex \
    --enable-sockets \
    --enable-zip \
    --enable-soap \
    --enable-bcmath \
    --with-iodbc=/usr \
    --with-curl=/usr \
    --with-xmlrpc \
    --with-xsl=/usr \
    --without-sqlite \
    --without-pear \
    --disable-short-tags

    Is without "--with-pgsql", because here also was a problem with architecture.
    Tomorrow , ohh it is 12:15 am ... so today I will try to re-compile PostgreSQL to 64-bit architecture.

Topic Closed

This topic has been closed to new replies.