I wanted to update my iMac (osx 10.5.6) from php 5.2.3 to 5.2.9 . I downloaded the source from this site, tried to install with some changes and screwed up my php. Come to find out that you need to use the ./configure command to set everything up JUST RIGHT for you computer. i ran this command in the terminal window while in the unzipped php-5.2.9 directory:
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --mandir=/usr/share/man --infodir=/usr/share/info --with-apxs2=/usr/sbin/apxs --with-curl --with-gd --enable-exif --enable-fastcgi --enable-zip --with-ldap=/usr --with-kerberos=/usr --with-zlib=/usr --enable-ftp --enable-sockets --with-iodbc=/usr --with-config-file-path=/etc --with-openssl --with-xmlrpc --with-xsl=/usr
make
sudo make install (then type your pw)
you can change the settings, but you'd better get it right!
mysql settings:
--with-mysql=/usr/local/mysql --with-mysql-sock=/var/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config
also, you can check out the apple developers site, that helped me.
if your apache server gets screwed up, use the note above to reinstall apache2, then install php, everything should work fine, it did for me.
MacOS X İstemcide Apache için PHP Modülü Derleme
Aşağıdaki talimatlar MacOS X'de bir PHP modülünü Apache HTTP sunucusuna kurmanıza yardımcı olacak. Bu sürüm MySQL, PostgreSQL ve iODBC veritabanlarından başka, cURL, GD, PDFLib, LDAP, vs. desteğini de içermektedir. Bu talimatlar » Marc Liyanage tarafından sağlanmıştır.
Bunu yaparken dikkatli olun, yoksa Apache HTTP sunucunuzu bozabilirsiniz!
Bilginize: Bu talimatlar sadece Apple tarafından dağıtılan özgün Apache HTTP sunucusunda çalışır. Apache’yi günceller veya yeniden derlerseniz PHP modülünü de yeniden derleyip kurmanız gerekir.
Kurulumu gerçekleştirmek için:
- Bir uçbirim penceresi açın.
-
Apache 1.3 için şunu indirin:
wget http://www2.entropy.ch/download/entropy-php-5.2.4-1.tar.gz -
Apache 2 için şunu indirin:
wget http://www2.entropy.ch/download/entropy-php-5.2.4-1-apache2.tar.gz - Sıkıştırılmış tar paketini açın. Fakat bunu yaparken StuffIt Expander KULLANMAYIN. Yerine Apple'ın BOMArchiveHelper'ını veya komut satırını kullanın.
- Paket kurucu uygulamaya çift tıklayıp uygulamayı başlatın ve uygulamadaki adımları izleyin.
Hepsi bu kadar! Artık PHP çalışıyor olmalı. Bunu ev dizininizdeki Sites dizinine dnm.php adında bir dosyayı yerleştirip deneyebilirsiniz. Bu dosyaya şu satırı yazın: <?php phpinfo() ?>
Şimdi tarayıcınızda 127.0.0.1/~kullanıcı_adınız/dnm.php sayfasını açın. PHP modülünüz hakkında bilgi içeren bir durum tablosu görüyor olmalısınız.
MacOS X İstemcide Apache için PHP Modülü Derleme
27-Feb-2009 08:15
07-Apr-2008 02:54
With OSX 10.5, the bundled version is up to date but didn't come with the modules I needed (notably I wanted the pgsql database extension).
Getting this to work was quite simple in the end, what made it difficult is the build-options for Apache. After searching on google, I found instructions to re-build apache with the following options:
./configure --enable-layout=Darwin --enable-mods-shared=all
(Step 1: download the latest Apache2.2 source files,
Step 2: extract the tarball
Step 3: ./configure --enable-layout=Darwin --enable-mods-shared=all
Step 4: make all
Step 5: sudo make install)
Without this step, when I rebuilt PHP either directly with the source from the PHP.net site or using MacPorts I was getting an error about the wrong architecture like this one:
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
After re-building and Apache with the configuration above and restarting it, everything worked again and I can now use PostgreSQL from within PHP on my MacBook Pro.
