首先下载5.4.33
wget http://museum.php.net/php5/php-5.4.33.tar.gz然后解压
tar zxvf php-5.4.33.tar.gz然后进入php-5.4.33文件夹中
./configure --prefix=/home/homework/php --with-config-file-path=/home/homework/php/etc --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-opcache --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-gettext --enable-mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl --enable-bcmath --enable-soap --with-libxml-dir --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --with-curl --with-zlib --enable-zip --with-bz2 --with-readline然后make
然后make install
然后编辑~/.bash_profile
PATH=$PATH:$HOME/bin:/home/homework/php/bin
然后source ~/.bash_profile
然后 php -v查看安装结果
如果想卸载,就用make clean
本文详细介绍了如何从源码安装 PHP 5.4.33 版本,包括下载、配置选项解释及安装步骤。通过 ./configure 脚本进行定制化安装,并提供了卸载指令。
1万+

被折叠的 条评论
为什么被折叠?



