gpt4 book ai didi

php - 调试 php.ini 语法错误

转载 作者:行者123 更新时间:2023-12-04 18:58:12 27 4
gpt4 key购买 nike

我有一个带有 ubuntu 12.04 并运行 apache2 作为 Web 服务器的 VM。我已经安装了 PHP 5.3.10,每次我运行一个 php 应用程序时,我的 php.ini 都会抛出这个错误:

PHP:  syntax error, unexpected BOOL_FALSE in /etc/php5/cli/php.ini on line 1020

我希望在 php.ini 中没有正确注释掉某些内容,但是当我查看它时,我看不出有什么问题:
1007 [Pcre]
1008 ;PCRE library backtracking limit.
1009 ; http://php.net/pcre.backtrack-limit
1010 ;pcre.backtrack_limit=100000
1011
1012 ;PCRE library recursion limit.
1013 ;Please note that if you set this value to a high number you may consume all
1014 ;the available process stack and eventually crash PHP (due to reaching the
1015 ;stack size limit imposed by the Operating System).
1016 ; http://php.net/pcre.recursion-limit
1017 ;pcre.recursion_limit=100000
1018
1019 [Pdo]
1020 ; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off"
1021 ; http://php.net/pdo-odbc.connection-pooling
1022 ;pdo_odbc.connection_pooling=strict
1023
1024 ;pdo_odbc.db2_instance_name
1025
1026 [Pdo_mysql]
1027 ; If mysqlnd is used: Number of cache slots for the internal result set cache
1028 ; http://php.net/pdo_mysql.cache_size
1029 pdo_mysql.cache_size = 2000
1030
1031 ; Default socket name for local MySQL connects. If empty, uses the built-in
1032 ; MySQL defaults.
1033 ; http://php.net/pdo_mysql.default-socket
1034 pdo_mysql.default_socket=

这有什么奇怪的吗?

所有应用程序都运行我只是厌倦了看到这个错误并且不知道是什么导致它。

最佳答案

简短的回答:

不要相信行号,在 行中查找语法错误之前 错误中提到的行。

长答案:

我也有这个错误,原来我在时区周围缺少引号。

我原来的错误是:

PHP:  syntax error, unexpected BOOL_FALSE in /etc/php5/cli/php.ini on line 929

在线 876 我有:
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Europe/Madrid"

在那之后有很多被注释掉的行,下一个未注释的行是 938 .原来的错误说 行有错误929 ,这让事情变得非常神秘。我认为行号的差异与 php.ini 文件的解析方式有关,但关键是行号不可信。

在我更正第 876 行缺少的引号后,错误消失了。

关于php - 调试 php.ini 语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17976757/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com