编译php中遇到的问题和解决方法
程序员文章站
2022-04-12 21:47:38
在编译php7.1.13的时候,出现了一些问题,编译参数如下:
[root@linux-node1 php-7.1.13]# ./configure --prefix=/us...
在编译php7.1.13的时候,出现了一些问题,编译参数如下:
[root@linux-node1 php-7.1.13]# ./configure --prefix=/usr/local/php \ --disable-debug \ --disable-phpdbg \ --enable-mysqlnd \ --enable-bcmath \ --with-bz2=/usr \ --enable-calendar \ --with-curl \ --enable-exif \ --enable-fpm \ --with-freetype-dir \ --enable-ftp \ --with-gd \ --enable-gd-jis-conv \ --enable-gd-native-ttf \ --with-gettext=/usr \ --with-gmp=/usr/include/linux \ --with-iconv \ --enable-intl \ --with-jpeg-dir \ --enable-mbstring \ --with-mcrypt \ --with-openssl \ --enable-pcntl \ --with-pdo-mysql=mysqlnd \ --with-png-dir \ --with-recode=/usr \ --enable-shmop \ --enable-soap \ --enable-sockets \ --enable-sysvmsg \ --enable-sysvsem \ --enable-sysvshm \ --enable-wddx \ --with-xmlrpc \ --with-xsl \ --with-zlib=/usr \ --enable-zip \ --with-mysqli=mysqlnd [root@linux-node1 php-7.1.13]# make ZEND_EXTRA_LIBS='-liconv' [root@linux-node1 php-7.1.13]# make install
针对这些问题,写出了相应的方法:
1、xpm.h not found $ yum -y install libXpm-devel #注意x为大写 $ yum -y install libXext-devel #注意x为大写 2、Unable to locate gmp.h(/usr/include/gmp.h) $ yum -y install gmp gmp-devel 备注:路径应该在/usr/include/gmp.h,如果不在/usr/include/目录下,可以做一个软链接 3、error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen $yum -y install libc-client-devel 4、error: Unable to detect ICU prefix or /usr/bin/icu-config failed $ yum -y install libicu* icu* 5、error: ODBC header file '/usr/include/sqlext.h' not found $ yum -y install unixODBC-devel 6、error: Cannot find pspell $ yum -y install aspell-devel 7、configure: error: Can not find recode.h anywhere under /usr /usr/local /usr /opt. $ yum -y install recode recode-devel 8、error: Could not find net-snmp-config binary $ yum -y install net-snmp-devel 9、error: Cannot find libtidy $ yum -y install libtidy-devel
以下是自己针对php的一些相关配置
1、php.ini 添加如下内容:
engine = On short_open_tag = Off realpath_cache_size = 2M max_execution_time = 86400 memory_limit = 1024M error_reporting = 0 display_errors = 0 display_startup_errors = 0 log_errors = 0 default_charset = "UTF-8" [opcache] zend_extension=opcache.so opcache.enable=1 opcache.enable_cli=1 opcache.optimization_level=-1 opcache.fast_shutdown=1 opcache.validate_timestamps=1 opcache.revalidate_freq=60 opcache.use_cwd=1 opcache.max_accelerated_files=100000 opcache.max_wasted_percentage=5 opcache.memory_consumption=128 opcache.consistency_checks=0 opcache.huge_code_pages=1 // PHP 8/Next only opcache.jit=35 opcache.jit_buffer_size=32M
2、在/usr/local/php/etc/php-fpm.d/www.conf的配置
[global] pid = /usr/local/php/var/run/php-fpm.pid error_log = /usr/local/php/var/log/php-fpm.log log_level = notice [www] listen = /tmp/php-cgi.sock listen.backlog = -1 listen.allowed_clients = 127.0.0.1 listen.owner = www listen.group = www listen.mode = 0666 user = www group = www pm = static pm.max_children = 300 pm.start_servers = 20 pm.min_spare_servers = 5 pm.max_spare_servers = 35 pm.max_requests = 10240 rlimit_files = 51200 request_terminate_timeout = 300 request_slowlog_timeout = 0 slowlog = var/log/slow.log
上一篇: 浅谈H5的入口与载体
下一篇: MySQL中的锁(表锁、行锁)详细讲解
推荐阅读
-
php的swoole扩展中onclose和onconnect接口不被调用的问题,swooleonclose_PHP教程
-
php中php.ini遇到的问题
-
Web 开发中遇到的UTF-8的问题总结_PHP
-
使用Yii框架中遇到的三个相关问题_PHP教程
-
PHP 出现乱码和Sessions验证问题的解决方法!_PHP
-
如何解决magento2安装过程中缺少两个php扩展的问题:ext-intl和ext-xsl
-
Eclipse中关于mybatis插件geneartor的使用和遇到的一些问题
-
php提取csv格式文件中的字符串出现的有关问题及解决方法
-
魔术方法 - php简单操作数组和对象时候遇到的两个问题,一起请教各位了
-
PHP编译安装中遇到的两个错误和解决方法_PHP