@admin 那个石头,安装好后,我添加进/usr/local/lsws/php/php.ini 代码: ; ================= ; Zend OPcache ; ================= zend_extension=opcache.so opcache.memory_consumption=128 opcache.interned_strings_buffer=8 opcache.max_accelerated_files=4000 opcache.revalidate_freq=60 opcache.fast_shutdown=1 opcache.enable_cli=1 重启过服务器,但还是没有生效,请问你知道怎么回事吗?谢谢! /usr/local/lsws/lsphp5/bin/php -v #也没有显示模块
1、先找到真正的php.ini 一般是 /usr/local/php/etc/php.ini 2、ZO在编译PHP的时候需要加 --enable-opcache 3、试试完整路径zend_extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/opcache.so
[root@localhost tmp]# find / -name php.ini -print /usr/local/lsws/php/php.ini /usr/local/lsws/admin/misc/php.ini /usr/local/lsws/admin/conf/php.ini 我以为勾选,OL编译会自动添加 --enable-opcache。 centos X32 我是在Actions——Compile PHP——勾选了下面的 代码: '--disable-fileinfo' '--prefix=/usr/local/lsws/lsphp5' $COMMAND '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-mysql-sock=/tmp/mysql.sock' '--with-iconv' '--with-freetype-dir=/usr/lib' '--with-jpeg-dir=/usr/lib' '--with-png-dir' '--with-zlib' '--with-libxml-dir=/usr' '--enable-xml' '--disable-rpath' '--enable-bcmath' '--enable-shmop' '--enable-exif' '--enable-sysvsem' '--enable-inline-optimization' '--with-curl' '--enable-mbregex' '--enable-mbstring' '--with-mcrypt' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-pcntl' '--enable-sockets' '--with-xmlrpc' '--enable-ftp' '--with-gettext' '--enable-sysvshm' '--enable-magic-quotes' '--with-curlwrappers' '--with-ldap' '--with-ldap-sasl' '--enable-zip' '--enable-soap' '--disable-debug' '--with-litespeed' Suhosin(General Hardening) XCache(Opcode Cache) V3.2.0 memcache(memcached extension) V2.2.7 所有的安装都一切正常,也按照litespeed 安装完成后的提示,去确认php.ini是否已添加,然后里面什么都没有添加,我添加进去重启服务器也无效,我以为是bug,然后虚拟机还原新环境,重新编译了1.3.11 stable,但结果还是一样的。 最奇怪的是,我把下面 /usr/local/lsws/php/php.ini /usr/local/lsws/admin/misc/php.ini /usr/local/lsws/admin/conf/php.ini 都重名为+php.ini 重启后,无论是openlitespeed还是xenforo都能正常安装,访问。http://192.168.1.4/phpinfo.php 也能正常打开? 简直见鬼了。 ; ================= ; Zend OPcache ; ================= zend_extension=opcache.so opcache.memory_consumption=128 opcache.interned_strings_buffer=8 opcache.max_accelerated_files=4000 opcache.revalidate_freq=60 opcache.fast_shutdown=1 opcache.enable_cli=1 ; ================= ; Suhosin ; ================= extension = suhosin.so extension = memcache.so
Configuration File (php.ini) Path /usr/local/lsws/lsphp5/lib [root@localhost ~]# ll /usr/local/lsws/lsphp5/lib total 4 drwxr-xr-x 15 root root 4096 Jun 15 12:03 php [root@localhost ~]# ll /usr/local/lsws/lsphp5/lib/php/ total 128 drwxr-xr-x 2 root root 4096 Jun 15 12:02 Archive drwxr-xr-x 2 root root 4096 Jun 15 11:59 build drwxr-xr-x 2 root root 4096 Jun 15 12:02 Console drwxr-xr-x 4 root root 4096 Jun 15 12:02 data drwxr-xr-x 6 root root 4096 Jun 15 12:02 doc drwxr-xr-x 3 root root 4096 Jun 15 12:03 extensions drwxr-xr-x 2 root root 4096 Jun 15 12:02 OS drwxr-xr-x 11 root root 4096 Jun 15 12:02 PEAR -rw-r--r-- 1 root root 1087 Jun 15 12:02 PEAR5.php -rw-r--r-- 1 root root 14539 Jun 15 12:02 pearcmd.php -rw-r--r-- 1 root root 33852 Jun 15 12:02 PEAR.php -rw-r--r-- 1 root root 1036 Jun 15 12:02 peclcmd.php drwxr-xr-x 3 root root 4096 Jun 15 12:02 Structures -rw-r--r-- 1 root root 20833 Jun 15 12:02 System.php drwxr-xr-x 4 root root 4096 Jun 15 12:02 test drwxr-xr-x 2 root root 4096 Jun 15 12:02 XML [root@localhost ~]# ll /usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20100525 total 1228 -rwxr-xr-x 1 root root 217804 Jun 15 12:03 memcache.so -rwxr-xr-x 1 root root 469853 Jun 15 12:04 opcache.so -rwxr-xr-x 1 root root 565189 Jun 15 12:03 suhosin.so
@admin 找到原因了。PHP默认加载的是php.ini-development 这个配置文件,怪不得 find 找不到。 cp /usr/local/lsws/phpbuild/php-5.4.41/php.ini-development /usr/local/lsws/lsphp5/lib/php.ini Configuration File (php.ini) Path /usr/local/lsws/lsphp5/lib Loaded Configuration File /usr/local/lsws/lsphp5/lib/php.ini This program makes use of the Zend Scripting Language Engine: Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies with XCache v3.2.0, Copyright (c) 2005-2014, by mOo with Suhosin v0.9.37.1, Copyright (c) 2007-2014, by SektionEins GmbH