Linux安装PHP5与PHP7共存(3)

7.php7模块路径:

[root@linuxidc php-7.1.6]# ls /usr/local/apache2.4/modules/libphp7.so /usr/local/apache2.4/modules/libphp7.so

8.查看php7加载的模块(静态):

[root@linuxidc php-7.1.6]# /usr/local/php7/bin/php -m [PHP Modules] bz2 Core ctype date dom exif fileinfo filter gd hash iconv json libxml mbstring mcrypt mysqli openssl pcre PDO pdo_mysql pdo_sqlite Phar posix Reflection session SimpleXML soap sockets SPL sqlite3 standard tokenizer xml xmlreader xmlwriter zlib [Zend Modules]

9.查看apache加载了几个php,通过修改配置文件来指定使用php5还是php7模块,不要的就注释掉:

示例如下:

[root@linuxidc php-7.1.6]# /usr/local/apache2.4/bin/apachectl -M AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 218.93.250.18. Set the 'ServerName' directive globally to suppress this message Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_event_module (static) authn_file_module (shared) authn_core_module (shared) authz_host_module (shared) authz_groupfile_module (shared) authz_user_module (shared) authz_core_module (shared) access_compat_module (shared) auth_basic_module (shared) reqtimeout_module (shared) filter_module (shared) mime_module (shared) log_config_module (shared) env_module (shared) headers_module (shared) setenvif_module (shared) version_module (shared) unixd_module (shared) status_module (shared) autoindex_module (shared) dir_module (shared) alias_module (shared) php5_module (shared) php7_module (shared) [root@linuxidc php-7.1.6]# vim /usr/local/apache2.4/conf/httpd.conf

Linux安装PHP5与PHP7共存

10.把php7的参考配置文件复制到php7的配置文件目录下:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/f9433db9f1360b2c37294bdce60531a4.html