安装 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)就不会出现这个问题了...
------------------------------------