我正在实施一个软件(Getsy需要 PHP 5.4 和 ZendGuard 6 ( ZendGuard ) 的软件 ( Getsy。
在这种情况下,我使用的是 Ubuntu 14.04 的 AWS 实例。由于 Ubuntu 14.04 默认带有 PHP 5.5+,我需要安装 PHP 5.4。为此,我安装了 PHP Farm。
要更改站点之间的 PHP 版本,我有这个 cgi-bin 脚本:
#!/bin/sh
PHP_FCGI_CHILDREN=3
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_MAX_REQUESTS
exec /opt/phpfarm/inst/bin/php-cgi-5.4.30
对于我的特定站点(站点更改为 ****),我有以下配置/etc/apache2/sites-enabled/****.conf
:
<VirtualHost *:80>
ServerAdmin ...@...
ServerName ****
ServerAlias ****
DocumentRoot /var/www/****/public_html/
ErrorLog /var/www/****/logs/error.log
LogLevel warn
CustomLog /var/www/****/logs/access.log combined
<Directory />
Options FollowSymLinks
AllowOverride All
AddHandler php-cgi .php
Action php-cgi /cgi-bin-php/php-cgi-5.4.30
</Directory>
</VirtualHost>
所以,当我运行我的网站时phpinfo()
一切都很好,并且该网站使用 PHP 5.4.30 运行。
现在,我需要启用 ZendGuard Loader 扩展。我使用以下命令从这里下载 64 位 linux 版本:
cd ~
wget http://downloads.zend.com/guard/6.0.0/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz
tar -xvf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz
cd ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64
cd php-5.4.x
mv ZendGuardLoader.so /usr/lib/php5/ZendGuardLoader.so
因此,之后,为了安装 PHP 5.4.30,我创建了文件custom-options-5.4.sh
:
#!/bin/bash
#gcov='--enable-gcov'
configoptions="--disable-debug \
--enable-short-tags \
--with-pear \
--enable-bcmath \
--enable-calendar \
--enable-exif \
--enable-ftp \
--enable-mbstring \
--enable-pcntl \
--enable-soap \
--enable-sockets \
--enable-wddx \
--enable-zip \
--with-zlib \
--with-gettext \
--enable-pdo \
--with-pdo-mysql \
--enable-cgi \
--enable-json \
--with-curl \
--with-gd \
--enable-gd \
--with-openssl \
--enable-openssl \
--with-mysql \
--enable-mysql \
$gcov"
我还使用自定义 php ini 文件作为custom-php.ini
:
include_path=".:/opt/phpfarm/inst/php-$version/pear/php/"
[Zend]
zend_extension="/usr/lib/php5/ZendGuardLoader.so"
之后,为了编译 PHP 版本,我使用以下命令:
cd /opt/phpfarm/src/
./compile 5.4.30
所以,紧接着我得到了所有的输出,并且正确安装了 php,但是当我检查 PHP 版本时,/opt/phpfarm/inst/bin/php-5.4.30 -v
我得到了这个输出:
PHP 5.4.30 (cli) (built: Sep 3 2014 23:41:33)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
由于某种原因,它没有加载 ZendGuard 扩展。当我检查phpinfo()
ZendGuard 时根本没有出现。当我检查线路在那里/opt/phpfarm/inst/php-5.4.30/lib/php.ini
。zend_extension="/usr/lib/php5/ZendGuardLoader.so"
任何想法为什么它不加载扩展或我如何启用它?