首页 > 代码库 > linux下安装配置php

linux下安装配置php

1.获得文件:

  php.tar.gz

2.安装libxml2:

  ./configure --prefix=/usr/local/libxml2; make; make install;

3.安装php:

  ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs=/usr/local/apache2/bin/apxs --with-libxml-dir=/usr/local/libxml2; make; make install;

4.配置apache:

  vi httpd.conf, 添加AddType application/x-httpd-php .php, AddType application/x-httpd-php-source .phps

  vi php.ini, registe-globals=on

  /etc/init.d/httpd restart

5.安装bcmath扩展:

  cd <php-src>/ext/bcmath;

  /usr/local/php/bin/phpize;

  ./configure --with-php-config=/usr/local/php/bin/php-config;

  make; make install;

  mv bcmath.so /usr/local/php/lib/php/extensions/;

  echo "extension=bcmath.so">>php.ini;

linux下安装配置php