PHP
downloads | documentation | faq | getting help | mailing lists | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Installation sur les système Windows> <Installation sur un système Mac OS X
Last updated: Fri, 14 Nov 2008

view this page in

Installation pour Apache sur les clients MacOS X

Les instructions suivantes vous aideront à installer un module PHP pour le serveur web Apache inclus dans MacOS X utilisant l'interface MacOS. Cette version inclue le support des bases de données MySQL, PostgreSQL, et iODBC, cURL, GD, PDFLib, LDAP, et bien plus. Ces instructions sont fournies par » Marc Liyanage.

Avertissement

Assurez-vous de savoir ce que vous faîtes avant d'aller plus loin ! Vous pouvez rendre votre installation d'Apache instable.

Note: Ces instructions ne fonctionneront qu'avec le serveur web Apache fourni par Apple.Si vous recompilez ou mettez à jour votre installation d'Apache, vous devrez compiler votre propre module PHP.

Pour l'installer :

  1. Pour Apache 1.3, téléchargez : http://www2.entropy.ch/download/entropy-php-5.2.4-1.tar.gz
  2. Pour Apache 2, téléchargez : wget http://www2.entropy.ch/download/entropy-php-5.2.4-1-apache2.tar.gz
  3. Décompressez le fichier .tar.gz file, mais n'utilisez pas StuffIt Expander. À la place, utilisez BOMArchiveHelper d'Apple ou la ligne de commande.
  4. Double-cliquez sur l'installeur du paquet et suivez les instructions.

C'est tout ! PHP doit maintenant être installé et doit fonctionner. Vous pouvez le tester en plaçant un fichier nommé test.php dans votre dossier Sites de votre répertoire personnel. Dans ce fichier, écrivez cette ligne : <?php phpinfo() ?>.

Maintenant, ouvez-le en plaçant 127.0.0.1/~your_username/test.php dans votre navigateur web favori. Vous devriez voir apparaître un tableau contenant les informations sur les modules PHP.



add a note add a note User Contributed Notes
Installation pour Apache sur les clients MacOS X
mdoyle at cooperationireland dot org
07-Apr-2008 04: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.
rahul
08-May-2007 09:54
if `wget` isn't installed or not in your path use `curl -O` instead.

 
show source | credits | sitemap | contact | advertising | mirror sites