安裝php報錯集合

原創作品,允許轉載,轉載時請務必以超鏈接形式標明文章 原始出處 、作者信息和本聲明。否則將追究法律責任。http://hbzylm.blog.51cto.com/613851/838796


安裝 php 編譯SNMP錯誤

新的監控server安裝centreon,需要php編譯snmp,安裝net-smp包之後仍然編譯報錯,如下:
checking OpenSSL dir for SNMP… no
checking for net-snmp-config… /usr/bin/net-snmp-config
checking for snmp_parse_oid in -lnetsnmp… no
checking for init_snmp in -lnetsnmp… no
configure: error: SNMP sanity check failed. Please check config.log for more information.
需要安裝:
elfutils-devel-0.97-5.i386.rpm
php-snmp-4.3.9-3.22.15
net-snmp-libs-5.1.2-13.el4_7.3
net-snmp-5.1.2-13.el4_7.3
net-snmp-utils-5.1.2-11.EL4.10
net-snmp-devel-5.1.2-13.el4_7.3
-----------------------------------------------
 測試時發現不能解析php,具體表現爲頁面空白,但可以解析html(就是能出來apache剛安裝好後的提示那個)
解決:<?php
phpinfo();
?>
?後少加了後綴php。這是php.ini沒有設置好的原因
; Allow the <? tag. Otherwise, only <?php and <script> tags are recognized.
; NOTE: Using short tags should be avoided when developing applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable code,
; be sure not to use short tags.
short_open_tag = Off
把這個設置爲ON也可以解決。。。。。。
-----------------------------------------------
再個問題就是:瀏覽器顯示錯誤信息如下: 
Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0 Fatal error: Unknown: Failed opening required '/usr/local/httpd/htdocs/phpinfo.php' (include_path='.:/usr/local/lib/php') in Unknown on line 0 
問題的原因是 : 你的phpinfo.php文件 在這個用戶下不具有 可讀的權限 通過 ls -l 查看 文件的權限 然後更改權限(添加讀權限 chmod +r phpinfo.php)就不會出現這個問題了...
------------------------------------
PHP的配置
Apache的配置文件是/usr/local/lib/php.ini,編輯php.ini文件來配置PHP的選項。特別注意的是,安裝完成後register_globals變量默認設置爲Off,需要將它改成On。否則會出現PHP讀不到post的數據的現象。
register_globals=On
其它PHP的選項請參考相關文檔。
測試
使用apachectl重新啓動apache服務
/usr/local/httpd/bin/apachectl restart
 
如果出錯::::::
(1)
啓動 apachectl 時出錯,說httpd.conf的53行有語法錯誤.libphp5.so模塊無法載入.
錯誤信息如下:
Syntax error on line 53 of /usr/local/apache2/conf/httpd.conf:
Can not load /usr/local/apache2/modules/libphp5.so   into server:
/usr/local/apache2/modules/libphp5.so:
Can't   restore   segment prot after reloc :   Permission   denied
解決: apache不能加載外掛php模塊這是由SELinux的安全策略配置不當引起的.在Fedora Core 的官方網站上有相關的Apache/SELinux的策略調整文檔.如果嫌麻煩,可以直接修改/etc/selinux/config 將SELinux禁用.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章