circle.ch weblog by Urs Gehrig

 Search
A weblog about libre software, law, technology, politics and the like.
2013-05-11T15:38:07
Academic, Android, Apache, Apple, Art, Best Of, Biotech, Civil Society, Content Management, Cooking, Copyright, Creative Commons, Crosspost, Culture, Database, Deutsch, DRM, Economy, Education, Event, Gadget, General, Geodata, Government, Health, Howto, Humor, Innovation, Intellectual Property, Java, Language, LaTeX, Law, Linux, Media, Moblog, Mozilla, Music, Office, Open Content, Open Source, P2P, PHP, Podcast, Politics, Privacy, Projects, Random Thought, Rant, Science, Search, Social Network, Software, Sport, Talks, Technology, Technology Transfer, Travelling, Weblog, Wiki, Wireless and Mobile, XML

24. March 2004

Apache2 with PHP5 CGI and PHP4 module on OS X
@ 15:15:30

Looking at the configuration now looks like it was a job at ease; but it took me some hours to work properly. PHP is now working in two versions in parallel on Apache2 on OS X 10.3.3. I will show you the configurations for the compilation first. Firstly, there is the configuration for PHP 4.3.4:
#:~/src/php-4.3.4 urs$ ./configure \
--disable-cgi \
--disable-pdo \
--enable-force-cgi-redirect \
--prefix=/usr/local/php \
--with-zlib \
--with-iconv=/sw/ \
--without-bundle-libxml \
--with-dom=/sw/ \
--with-libxml-dir=/sw/ \
--with-xsl=/sw/ \
--disable-pear \
--with-gd \
--with-freetype-dir=/sw/lib/freetype2/ \
--with-jpeg-dir=/sw/ \
--with-png-dir=/sw/ \
--enable-sockets \
--enable-pcntl \
--enable-shmop \
--enable-sysvshm \
--enable-sysvsem \
--with-mysql=/usr/local/mysql/ \
--enable-debug \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-config-file-path=/usr/local/php \
--with-config-file=/usr/local/php/php.ini
As below, this is what you can type to get PHP 5.0.0 RC1:
#:~/src/php-5.0.0RC1 urs$ ./configure \
--enable-force-cgi-redirect \
--prefix=/usr/local/php5-cgi \
--with-zlib \
--with-iconv=/sw/ \
--without-bundle-libxml \
--with-dom=/sw/ \
--with-libxml-dir=/sw/ \
--with-xsl=/sw/ \
--disable-pear \
--with-gd \
--with-freetype-dir=/sw/lib/freetype2/ \
--with-jpeg-dir=/sw/ \
--with-png-dir=/sw/ \
--with-mysql=/usr/local/mysql/ \
--enable-debug \
--with-config-file-path=/usr/local/php5-cgi \
--with-config-file=/usr/local/php5-cgi/php.ini
I have chose specific configuration paths for each version. As far as I can see, you need to give the path and the filename as well. Especially for the CGI version, you should specify the option --enable-force-cgi-redirect.

Now the tricky part was to get a working configuration for the virtual hosts. The idea behind is to have a PHP 4 module installed as default and a per-virtual-host-configuration for other versions of PHP; that might be PHP 5 or 3. So on port 86 php scripts will be processed by PHP 5.0.0 RC1.

Listen 86
<VirtualHost _default_:86>
ServerName localhost

ScriptAlias /php5 /usr/local/php5-cgi/bin/
<Directory /usr/local/php5-cgi/bin/>
Options +ExecCGI +FollowSymLinks
AllowOverride None
</Directory>

DocumentRoot /Library/Webserver/Documents/project-a
<Directory /Library/Webserver/Documents/project-a>
DirectoryIndex index.php
Options Includes Indexes FollowSymLinks MultiViews
AllowOverride None Options FileInfo
Action php5-cgi /php5/php
AddHandler php5-cgi .php .php5
</Directory>

ErrorLog logs/default_86-error_log
CustomLog logs/default_86-access_log combined
</VirtualHost>

<VirtualHost *>
LoadModule php4_module modules/libphp4.so
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
DocumentRoot /Library/Webserver/
<Directory /Library/Webserver/>
DirectoryIndex index.php
Options Includes Indexes FollowSymLinks MultiViews
AllowOverride None Options FileInfo
</Directory>
</VirtualHost>
I collected various links and jotted down some eventually interesting information in the (Wiki/PHP5).

Comments (2) Permalink del.icio.us

The URL to TrackBack this entry is:
   http://circle.ch/blog/b2trackback.php/1392

  1. Comment by pilgrim @ 2004-04-01 22:29:08:
    pilgrim’s Gravatar Hi, just a question about the "LoadModule" for php4 in the virtual host: it is said in the apache 1.3 and apache 2 that this directive can't be in a virtual host... So how it is possible to work ? ;-)
  2. Comment by Urs @ 2004-04-05 11:03:56:
    Urs’s Gravatar Hello Mark - as I guess you are ;-)

    You are right, inbetween I removed that LoadModule configuration setting as because of reasons you mentioned. The current settings look now like:

    LoadModule php4_module modules/libphp4.so
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps

    <Directory *>
    DirectoryIndex index.php
    Options Includes Indexes FollowSymLinks MultiViews
    AllowOverride None Options FileInfo
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
    </Directory>

    Liste 89
    <VirtualHost _default_:89>
    # Some settings for this specific VirtualHost
    </VirtualHost>
    ThanQ for your feedback.

Comments closed.



Werbung:

Beiträge von Dritten:

Nachfolgende Titel verweisen auf von mir gelesene Weblogs.

Feeds:

Blog Content
Blog Comments

WikiAgenda:

Comments:

Good question, but...
Hi, thank you very...
Unter http://www.s...
Ich weiss mir nich...
ThanQ matthias. Th...
in case you just w...
ich liebe dir, urs...
hi there, sorry i...
Hoi Leo. I haven'...
Do you know the si...

Archives:

Blog stack:

Bill Humphries
monorom
Wendy M. Seltzer
Christian Stocker
Roger Fischer
Sandro Zic
Wez Furlong
Ben Hammersley
George Schlossnagle
Joichi Ito
Lawrence Lessig
Derek Slater
Karl-Friedrich Lenz
John Palfrey
Bernhard A.M. Seefeld
Gregor J. Rothfuss
Rainer Langenhan
Elke Engel
Sebastian Bergmann
Simon Willison
Jeremy Zwaodny
Udo Vetter
Axel A. Horns
Miguel de Icaza
Andreas Halter
Silvan Zurbrügg
Hannes Gassert
Markus Koller


$Date: 2005/11/05 11:14:30 $