Debian安装php
司空思聪
2023-12-01
1.安装apr
2.安装apr-util: ./configure --with-apr=/usr/local/apr --with-mysql=/opt/mariadb
3.http://pcre.org/ 下载 libpcre, 并安装
4.安装httpServer
5.ftp://xmlsoft.org/libxml2/ 下载 libxml2, 并安装
6.安装php: ./configure --with-mysql=/opt/mariadb --with-apxs2=/usr/local/apache2/bin/apxs
PHP安装成功后会在“--with-apxs2”指定的apache的modules文件夹生成libphp5.so
7.cp /opt/php/php-5.5.8/php.ini-development /usr/local/lib/php.ini
8.编辑vim /usr/local/apache2/conf/httpd.conf 增加AddType application/x-httpd-php .php
LoadModule php5_module modules/libphp5.so
PHPIniDir [php.ini所在目录]
9.安装zlib
10.参考博客:不重新编译PHP为PHP安装zlib扩展
./configure --with-php-config=/usr/local/bin/php-config --with-zlib=/usr/local/