本文介绍了PHP 7.2:无需解析其他.ini文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ubuntu服务器(16.04.4 LTS),其apache2运行php7.0(Apache 2.0处理程序)和php7.2(FPM/FastCGI).

I have an ubuntu server (16.04.4 LTS) with apache2 running php7.0 (Apache 2.0 Handler) and php7.2 (FPM/FastCGI).

PHP7.2可以正常工作,除了没有加载扩展-像json或其他任何东西.看到我的phpinfo():

PHP7.2 works fine, except that there are no extensions loaded - like json or anything else. See my phpinfo():

System  Linux srvindkdif 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64
Build Date  Jun 22 2018 08:44:50
Server API  FPM/FastCGI
Virtual Directory Support   disabled
Configuration File (php.ini) Path   /etc/php/7.2/fpm
Loaded Configuration File   /etc/php/7.2/fpm/php.ini
Scan this dir for additional .ini files /etc/php/7.2/fpm/conf.d
Additional .ini files parsed    (none)
PHP API 20170718
PHP Extension   20170718
Zend Extension  320170718
Zend Extension Build    API320170718,NTS
PHP Extension Build API20170718,NTS
Debug Build no
Thread Safety   disabled
Zend Signal Handling    enabled
Zend Memory Manager enabled
Zend Multibyte Support  disabled
IPv6 Support    enabled
DTrace Support  available, disabled
Registered PHP Streams  https, ftps, compress.zlib, php, file, glob, data, http, ftp
Registered Stream Socket Transports tcp, udp, unix, udg, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2
Registered Stream Filters   zlib.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk

我想问题是,没有其他的.ini文件被解析.但是phpinfo表示,它会扫描目录/etc/php/7.2/fpm/conf.d中是否存在其他.ini文件.这是目录列表:

I guess the problem is, that no additional .ini files are parsed. But phpinfo says it scans the directory /etc/php/7.2/fpm/conf.d for additional .ini files.Here's the directory list:

/etc/php/7.2/fpm/conf.d> ll
insgesamt 8
drwxr-xr-x 2 root root 4096 Jun 25 16:07 ./
drwxr-xr-x 4 root root 4096 Jun 26 09:10 ../
lrwxrwxrwx 1 root root   39 Jun 25 16:06 10-mysqlnd.ini -> /etc/php/7.2/mods-available/mysqlnd.ini
lrwxrwxrwx 1 root root   39 Jun 25 16:06 10-opcache.ini -> /etc/php/7.2/mods-available/opcache.ini
lrwxrwxrwx 1 root root   35 Jun 25 16:06 10-pdo.ini -> /etc/php/7.2/mods-available/pdo.ini
lrwxrwxrwx 1 root root   35 Jun 25 16:06 15-xml.ini -> /etc/php/7.2/mods-available/xml.ini
lrwxrwxrwx 1 root root   40 Jun 25 16:06 20-calendar.ini -> /etc/php/7.2/mods-available/calendar.ini
lrwxrwxrwx 1 root root   37 Jun 25 16:06 20-ctype.ini -> /etc/php/7.2/mods-available/ctype.ini
lrwxrwxrwx 1 root root   36 Jun 25 16:06 20-curl.ini -> /etc/php/7.2/mods-available/curl.ini
lrwxrwxrwx 1 root root   35 Jun 25 16:06 20-dom.ini -> /etc/php/7.2/mods-available/dom.ini
lrwxrwxrwx 1 root root   36 Jun 25 16:06 20-exif.ini -> /etc/php/7.2/mods-available/exif.ini
lrwxrwxrwx 1 root root   40 Jun 25 16:06 20-fileinfo.ini -> /etc/php/7.2/mods-available/fileinfo.ini
lrwxrwxrwx 1 root root   35 Jun 25 16:06 20-ftp.ini -> /etc/php/7.2/mods-available/ftp.ini
lrwxrwxrwx 1 root root   34 Jun 25 16:06 20-gd.ini -> /etc/php/7.2/mods-available/gd.ini
lrwxrwxrwx 1 root root   39 Jun 25 16:06 20-gettext.ini -> /etc/php/7.2/mods-available/gettext.ini
lrwxrwxrwx 1 root root   37 Jun 25 16:02 20-iconv.ini -> /etc/php/7.2/mods-available/iconv.ini
lrwxrwxrwx 1 root root   36 Jun 25 15:55 20-json.ini -> /etc/php/7.2/mods-available/json.ini
lrwxrwxrwx 1 root root   40 Jun 25 16:03 20-mbstring.ini -> /etc/php/7.2/mods-available/mbstring.ini
lrwxrwxrwx 1 root root   38 Jun 25 16:06 20-mysqli.ini -> /etc/php/7.2/mods-available/mysqli.ini
lrwxrwxrwx 1 root root   41 Jun 25 16:06 20-pdo_mysql.ini -> /etc/php/7.2/mods-available/pdo_mysql.ini
lrwxrwxrwx 1 root root   36 Jun 25 16:06 20-phar.ini -> /etc/php/7.2/mods-available/phar.ini
lrwxrwxrwx 1 root root   37 Jun 25 16:06 20-posix.ini -> /etc/php/7.2/mods-available/posix.ini
lrwxrwxrwx 1 root root   40 Jun 25 16:06 20-readline.ini -> /etc/php/7.2/mods-available/readline.ini
lrwxrwxrwx 1 root root   37 Jun 25 16:06 20-shmop.ini -> /etc/php/7.2/mods-available/shmop.ini
lrwxrwxrwx 1 root root   41 Jun 25 16:06 20-simplexml.ini -> /etc/php/7.2/mods-available/simplexml.ini
lrwxrwxrwx 1 root root   39 Jun 25 16:06 20-sockets.ini -> /etc/php/7.2/mods-available/sockets.ini
lrwxrwxrwx 1 root root   39 Jun 25 16:06 20-sysvmsg.ini -> /etc/php/7.2/mods-available/sysvmsg.ini
lrwxrwxrwx 1 root root   39 Jun 25 16:06 20-sysvsem.ini -> /etc/php/7.2/mods-available/sysvsem.ini
lrwxrwxrwx 1 root root   39 Jun 25 16:06 20-sysvshm.ini -> /etc/php/7.2/mods-available/sysvshm.ini
lrwxrwxrwx 1 root root   41 Jun 25 16:06 20-tokenizer.ini -> /etc/php/7.2/mods-available/tokenizer.ini
lrwxrwxrwx 1 root root   36 Jun 25 16:06 20-wddx.ini -> /etc/php/7.2/mods-available/wddx.ini
lrwxrwxrwx 1 root root   41 Jun 25 16:06 20-xmlreader.ini -> /etc/php/7.2/mods-available/xmlreader.ini
lrwxrwxrwx 1 root root   41 Jun 25 16:06 20-xmlwriter.ini -> /etc/php/7.2/mods-available/xmlwriter.ini
lrwxrwxrwx 1 root root   35 Jun 25 16:06 20-xsl.ini -> /etc/php/7.2/mods-available/xsl.ini
lrwxrwxrwx 1 root root   35 Jun 25 16:06 20-zip.ini -> /etc/php/7.2/mods-available/zip.ini

我已经重新启动了apache2服务器,但没有任何效果.

I have restarted apache2 server with no effect.

如何告诉我的php-fpm使用这些扩展名?

How can I tell my php-fpm to use those extensions?

推荐答案

除了重新启动apache之外,您还重新启动了fpm吗?

As well as restarting apache, did you also restart fpm?

这篇关于PHP 7.2:无需解析其他.ini文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 14:34