新聞中心
PHP是一種廣泛使用的開源服務(wù)器端腳本語言,用于Web開發(fā)和編程。在Web應(yīng)用程序開發(fā)過程中,PHP錯(cuò)誤日志是一個(gè)非常重要的文件,用于記錄各種PHP錯(cuò)誤和異常的詳細(xì)信息。在Linux系統(tǒng)中,查看和分析PHP錯(cuò)誤日志可以幫助開發(fā)人員識(shí)別和修復(fù)應(yīng)用程序中的錯(cuò)誤和問題,提高應(yīng)用程序的性能和穩(wěn)定性。本文將介紹如何在Linux系統(tǒng)下查看PHP錯(cuò)誤日志的方法。

方法一:查看Apache訪問日志
Apache訪問日志是記錄服務(wù)器請求和響應(yīng)的文件,其中包含PHP運(yùn)行時(shí)的錯(cuò)誤信息。可以使用以下命令查看Apache訪問日志:
$tl -f /var/log/httpd/access_log
該命令將以實(shí)時(shí)模式跟蹤并輸出Apache訪問日志,您可以在文件中搜索PHP的錯(cuò)誤信息。
方法二:查看Apache以及PHP錯(cuò)誤日志
Apache錯(cuò)誤日志和PHP錯(cuò)誤日志是記錄Apache和PHP運(yùn)行時(shí)錯(cuò)誤和異常的文件??梢允褂靡韵旅畈榭碅pache和PHP錯(cuò)誤日志:
$tl -f /var/log/httpd/error_log
$tl -f /var/log/httpd/php_error_log
這些命令將以實(shí)時(shí)模式跟蹤并輸出Apache和PHP錯(cuò)誤日志,您可以在文件中搜索任何PHP的警告、錯(cuò)誤或致命錯(cuò)誤。
方法三:使用PHP ini文件查看錯(cuò)誤日志
PHP.ini文件是用于配置PHP的默認(rèn)參數(shù)和運(yùn)行時(shí)配置的文件,其中也包含PHP錯(cuò)誤日志的配置??梢允褂靡韵旅畈榭碢HP.ini文件的位置:
$php –ini
然后打開該文件,并搜索以下行:
error_log = /var/log/php_error_log
打開對應(yīng)的PHP錯(cuò)誤日志,并查找錯(cuò)誤或異常信息。
方法四:使用命令行查看PHP錯(cuò)誤日志
Linux系統(tǒng)提供了一些內(nèi)置的命令,可以用來查找和過濾日志文件中的信息??梢允褂靡韵旅畈檎襊HP錯(cuò)誤日志中的信息:
$grep “PHP Fatal error” /var/log/php_error_log
該命令將搜索文件,并輸出所有PHP致命錯(cuò)誤的信息。
PHP錯(cuò)誤日志是開發(fā)人員識(shí)別和修復(fù)Web應(yīng)用程序錯(cuò)誤和問題的重要工具。在Linux系統(tǒng)中,您可以使用以上方法查看PHP錯(cuò)誤日志,提高Web應(yīng)用程序的性能和穩(wěn)定性。
成都網(wǎng)站建設(shè)公司-創(chuàng)新互聯(lián)為您提供網(wǎng)站建設(shè)、網(wǎng)站制作、網(wǎng)頁設(shè)計(jì)及定制高端網(wǎng)站建設(shè)服務(wù)!
求問php configure err 錯(cuò)誤怎么辦
php-configure錯(cuò)誤解決
configure: error: libjpeg.(a|so) not found
configure: error: libjpeg.(a|so) not found
ln -sf libjpeg.so.62.0.0 libjpeg.so
configure: error: libpng.(a|so) not found.
yum install libpng-devel
32位和64位的都裝了。你可以強(qiáng)制刪除兩個(gè)包,再重裝64位的包。
rpm –allmatches –nodeps
可能在config結(jié)束后會(huì)提示:
configure: error: libjpeg.(a|so) not found
configure: error: libjpng.(a|so) not found
錯(cuò)誤,那么請?jiān)赾onfigure前執(zhí)行如下的命令:
cp -frp /usr/lib64/libjpeg.* /usr/lib/
cp -frp /usr/lib64/libpng* /usr/lib/
因?yàn)閜hp默認(rèn)就在/usr/lib/下找相關(guān)庫文件,而x64機(jī)器上是在:/usr/lib64
解決這個(gè)拿巖問題,首先確定你安裝的 jpeg的x86_64的的安裝位置
shell> updatedb
shell> locate libjpeg.so
看或則到已經(jīng)安裝位置
然后明白php參數(shù)的含義
根據(jù)php的配置參數(shù)
–with-jpeg-dir=/usr –with-libdir=lib64
–with-jpeg-dir=/usr :是確定jpeg的安裝位置
–with-libdir=lib64 : 這個(gè)是一個(gè)全局參數(shù),代表配置器尋找所有安裝路徑下的lib64目錄,而不是默認(rèn)安裝路徑下的lib目消團(tuán)御錄
CentOS 5 常見的configure error的解決方法:23僅限于CentOS 5
configure: error: No curses/termcap library found
網(wǎng)上有的說法是:
–with-named-curses-libs=/usr/lib/libncursesw.so.5
其實(shí)是不對的,雖然能解決configure的錯(cuò)誤,但是make的時(shí)候會(huì)提示錯(cuò)誤,正確的做法應(yīng)該是
yum -y install ncurses-devel
debian: apt-get install libncurses5-dev
configure: error: xml2-config not found
yum -y install libxml2-devel
debian:apt-get install libxml2-dev
configure: error: Cannot find OpenSSL’s
yum -y install openssl-devel
configure: error: libjpeg.(a|so) not found
yum -y install gd
yum -y install gd-devel
debian:apt-get install libjpeg-dev
configure: error: libpng.(a|so) not found.
apt-get install libpng12-dev
configure: error: cannot find output from lex; giving up
yum -y install flex
configure: error: mod_deflate has been requested but can not be built due to prerequisite failures
yum -y install zlib-devel openssl-devel
debian:apt-get install zlib1g-dev
configure: error: libXpm.(a|so) not found.
apt-get install libxpm-dev
onfigure: error: freetype.h not found.
apt-get install libfreetype6-dev
configure: error: …No recognized SSL/TLS toolkit detected
apt-get install libssl-dev
在x64的機(jī)器上編譯PHP+GD的時(shí)候需要注意一下
Written by bixuan on 2023年04月12號(hào) – 11:04
php編譯常見錯(cuò)誤大全Posted in linux相關(guān) | 七月 22nd, 2023
1) Configure: error: xml2-config not found. Please check your libxml2 installation.
Solutions :
yum install libxml2 libxml2-devel (For Redhat & Fedora)
# aptitude install libxml2-dev (For ubuntu)
2) Checking for pkg-config… /usr/bin/pkg-config
configure: error: Cannot find OpenSSL’s
Solutions :
yum install openssl openssl-devel
3) Configure: error: Please reinstall the BZip2 distribution
Solutions :
yum install bzip2 bzip2-devel
4) Configure: error: Please reinstall the libcurl distribution –
easy.h should be in /include/curl/
Solutions :
yum install curl curl-devel (For Redhat & Fedora)
# install libcurl4-gnutls-dev (For Ubuntu)
5) Configure: error: libjpeg.(also) not found.
Solutions :
yum -y install gd
yum -y install gd-devel
yum install libjpeg libjpeg-devel
6) Configure: error: libpng.(also) not found.
Solutions :
yum install libpng libpng-devel
apt-get install libpng12-dev
7) Configure: error: freetype.h not found.
Solutions :
yum install freetype-devel
Configure: error: Unable to locate gmp.h
Solutions :
yum install gmp-devel
9) Configure: error: Cannot find MySQL header files under /usr.
Note that the MySQL client library is not bundled anymore!
Solutions :
yum install mysql-devel (For Redhat & Fedora)
# apt-get install libmysql++-dev (For Ubuntu)
10) Configure: error: Please reinstall the ncurses distribution
Solutions :
yum install ncurses ncurses-devel
11) Checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h’ not found!
Solutions :
yum install unixODBC-devel
12) Configure: error: Cannot find pspell
Solutions :
yum install pspell-devel
13) configure: error: mcrypt.h not found. Please reinstall libmcrypt.
Solutions :
yum install libmcrypt libmcrypt-devel (For Redhat & Fedora)
# apt-get install libmcrypt-dev
14) Configure: error: snmp.h not found. Check your SNMP installation.
Solutions :
yum install net-snmp net-snmp-devel
15)開啟LDAP服務(wù)還需要
yum -y install openldap-devel openldap-servers openldap-clients
16)configure: error: No curses/termcap library found
網(wǎng)上有的說法是:
–with-named-curses-libs=/usr/lib/libncursesw.so.5
其實(shí)是不對的,雖然能解決configure的錯(cuò)誤,但是make的時(shí)候會(huì)提示錯(cuò)誤,正確的做法應(yīng)該是
yum -y install ncurses-devel (for redhat)
apt-get install libncurses5-dev(for debian)
17)configure: error: cannot find output from lex; giving up
yum -y install flex
18)configure: error: mod_deflate has been requested but can not be built due to prerequisite failures
yum -y install zlib-devel openssl-devel
debian:apt-get install zlib1g-dev
19)configure: error: libXpm.(a|so) not found.
apt-get install libxpm-dev
補(bǔ)充:通過以上命令配置PHP時(shí),遇到錯(cuò)誤,總說找不到libmcrypt。由于這服務(wù)器是個(gè)裸機(jī),很多必須的庫都沒裝,必須一個(gè)一個(gè)的手動(dòng)安裝,可libmcrypt這個(gè)庫我的確裝過了。重試n遍,無解,解決方案
Then I visited
an learned that I have to install not only libmcrypt
but also mcrypt and libmhash.
Here is the to do:
libmcrytp:
———–
download libmcrypt-xxx.tar.gz
create the following directory: / usr / local / libmcrypt
copy the libmcrypt-xxx.tar.gz into that directory and move to it
run the following shell (>) commands: (’xxx’ is the version number)
> gunzip -c libmcrypt-xxx.tar.gz | tar xf –
> cd libmcrypt-xxx
> ./configure –disable-posix-threads
> make
> make check (note: ‘make check’ is optional)
> make install
then (update your environment) add in / etc / profile the following path:
/usr/local/libmcrypt/libmcrypt-xxxx
(note: as I run Red Hat 7.3 I set the line a f t e r the if-part
(id -u = 0 …) with: pathmunge /usr/local / libm….)
and add in / etc / ld.so.conf the following path: /usr/local/lib
then run ldconfig:
> ldconfig
now comes the important part:
> cd /usr/local/libmcrypt/libmcrypt-xxx/libltdl
> ./configure –enable-ltdl-install
> make
> make install
(maybe not needed: I also added a link in / usr / bin: )
(> cd /usr/bin)
(> ln -s /usr/lib/libltdl.so.3.1.0 ltdl)
mhash:
———–
download mhash-xxx.tar.gz
create the following directory: / usr / local / mhash
copy the mhash-xxx.tar.gz into that directory and move to it
run the following shell (>) commands: (’xxx’ is the version number)
> gunzip -c mhash-xxx.tar.gz | tar xf –
> cd mhash-xxx
> ./configure
> make
> make check (note: ‘make check’ is optional)
> make install
mcrypt:
———–
download mcrypt-xxx.tar.gz
create the following directory: / usr / local / mcrypt
copy the mcrypt-xxx.tar.gz into that directory and move to it
run the following shell (>) commands: (’xxx’ is the version number)
> gunzip -c mcrypt-xxx.tar.gz | tar xf –
> cd mhash-xxx
> ./configure
> make
> make check (note: ‘make check’ is optional)
> make install
back to PHP:
————–
move into your PHP installation directory
then the following command worked on my computer:
>
./configure –with-apache=/usr/local/apache/apache_1.3.29 –with-mysql –wit
h-mcrypt=/usr/local/mcrypt/mcrypt-2.6.4
> make
> make install
linux 查看php錯(cuò)誤日志的介紹就聊到這里吧,感謝你花時(shí)間閱讀本站內(nèi)容,更多關(guān)于linux 查看php錯(cuò)誤日志,如何在Linux下查看PHP錯(cuò)誤日志?,求問php configure err 錯(cuò)誤怎么辦的信息別忘了在本站進(jìn)行查找喔。
香港云服務(wù)器機(jī)房,創(chuàng)新互聯(lián)(www.cdcxhl.com)專業(yè)云服務(wù)器廠商,回大陸優(yōu)化帶寬,安全/穩(wěn)定/低延遲.創(chuàng)新互聯(lián)助力企業(yè)出海業(yè)務(wù),提供一站式解決方案。香港服務(wù)器-免備案低延遲-雙向CN2+BGP極速互訪!
新聞名稱:如何在Linux下查看PHP錯(cuò)誤日志?(linux查看php錯(cuò)誤日志)
文章地址:http://fisionsoft.com.cn/article/dhhisco.html


咨詢
建站咨詢
