Difference between revisions of "PHP"

From CBLFS
Jump to navigationJump to search
Line 32: Line 32:
  
 
See the output of '''./configure --help''' for more configuration options.
 
See the output of '''./configure --help''' for more configuration options.
 +
If you use Apache 1 then you must use --with-apxs instead --with-apxs2
 +
  
 
== Non-Multilib ==
 
== Non-Multilib ==
Line 45: Line 47:
  
 
  make install
 
  make install
   
+
  cp php.ini-recommended /etc/php/php.ini
 +
 
 
The installscript change your Apache config and add the entry: "LoadModule php4_module  lib/apache/libphp4.so"
 
The installscript change your Apache config and add the entry: "LoadModule php4_module  lib/apache/libphp4.so"
 
But it forgets to set the mime applicationtype. So go to the /etc/apache/httpd.conf and add fowlling line under
 
But it forgets to set the mime applicationtype. So go to the /etc/apache/httpd.conf and add fowlling line under
Line 52: Line 55:
 
  AddType application/x-httpd-php .php .phtml .php3 .htm .html
 
  AddType application/x-httpd-php .php .phtml .php3 .htm .html
  
 +
== Multilib ==
 +
 +
=== 32Bit ===
 +
 +
Compile the package:
 +
 +
CC="gcc ${BUILD32}" PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" USE_ARCH=32 \
 +
./configure --prefix=/usr --sysconfdir=/etc/php --libdir=/usr/lib --localstatedir=/var \ --with-apxs2=/usr/sbin/apxs --with-mysql
 +
make &&
 +
 +
Install the package:
 +
 +
make install
 +
mv -v /usr/bin/php-config{,-32}
 +
cp php.ini-recommended /etc/php/php.ini
  
 +
The installscript change your Apache config and add the entry: "LoadModule php4_module  lib/apache/libphp4.so"
 +
But it forgets to set the mime applicationtype. So go to the /etc/apache/httpd.conf and add fowlling line under
 +
<IfModule mime_module>:
  
 +
AddType application/x-httpd-php .php .phtml .php3 .htm .html
  
mv -v /usr/bin/php-config{,-32}
+
If you build also a 64Bit PHP, you must:
 +
 +
rm -f /etc/php/pear.conf
  
  
 
NOTE: NOT FINISHED YET! PLEASE WATCH OUT!
 
NOTE: NOT FINISHED YET! PLEASE WATCH OUT!

Revision as of 01:58, 28 February 2007

Download Source: http://www.php.net/get/php-5.2.1.tar.bz2/from/this/mirror

Introductin to PHP

PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.

Warning:

The PHP Developer team means:

"We do not recommend using a threaded MPM in production with Apache2. Use the prefork MPM instead, or use Apache1. For information on why, read the related FAQ entry on using Apache2 with a threaded MPM"[1]"

Dependencies

Required

Optional

Configuration Information

See the output of ./configure --help for more configuration options. If you use Apache 1 then you must use --with-apxs instead --with-apxs2


Non-Multilib

Compile the package:

./configure --prefix=/usr --sysconfdir=/etc/php \
    --libdir=/usr/lib --localstatedir=/var \
    --with-apxs2=/usr/sbin/apxs --with-mysql &&
make

Install the package:

make install
cp php.ini-recommended /etc/php/php.ini

The installscript change your Apache config and add the entry: "LoadModule php4_module lib/apache/libphp4.so" But it forgets to set the mime applicationtype. So go to the /etc/apache/httpd.conf and add fowlling line under <IfModule mime_module>:

AddType application/x-httpd-php .php .phtml .php3 .htm .html

Multilib

32Bit

Compile the package:

CC="gcc ${BUILD32}" PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" USE_ARCH=32 \
./configure --prefix=/usr --sysconfdir=/etc/php --libdir=/usr/lib --localstatedir=/var \ --with-apxs2=/usr/sbin/apxs --with-mysql
make &&

Install the package:

make install
mv -v /usr/bin/php-config{,-32}
cp php.ini-recommended /etc/php/php.ini

The installscript change your Apache config and add the entry: "LoadModule php4_module lib/apache/libphp4.so" But it forgets to set the mime applicationtype. So go to the /etc/apache/httpd.conf and add fowlling line under <IfModule mime_module>:

AddType application/x-httpd-php .php .phtml .php3 .htm .html

If you build also a 64Bit PHP, you must:

rm -f /etc/php/pear.conf


NOTE: NOT FINISHED YET! PLEASE WATCH OUT!