php cli配置文件问题分析(2)

Warning: PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/fileinfo.so' - /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/fileinfo.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/gd.so' - /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/gd.so' - /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/json.so' - /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/json.so: cannot open shared object file: No such file or directory in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/json.so' - /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/json.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/phar.so' - /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/phar.so: cannot open shared object file: No such file or directory in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/phar.so' - /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/phar.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/data/boss/phpredis-develop/modules/redis.so' - /data/boss/phpredis-develop/modules/redis.so: undefined symbol: zend_new_interned_string in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/data/boss/phpredis-develop/modules/redis.so' - /data/boss/phpredis-develop/modules/redis.so: undefined symbol: zend_new_interned_string in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/zip.so' - /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/zip.so: cannot open shared object file: No such file or directory in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/zip.so' - /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/zip.so: cannot open shared object file: No such file or directory in Unknown on line 0
protoc-php.php requires protobuf extension installed to run

这让我摸不着头脑了。

时间过去了好久,没有发现任何突破,却发现了一个备用的解决这个问题的方案,修改/data/php_proto/文件夹权限为0775,其他普通用户就可以直接使用了,不用加sudo(这个是我的错,忘记修改文件夹权限了,这也让我发现了这个诡异的问题)

chmod -R 0775 /data/php_proto
看了报的这些错误,大部分都是扩展的问题,有的是扩展加载不成功,有的是扩展不存在,我就纳闷了,为什么普通用户可以,root用户就不可以。

看到root用户php -i的时候,配置文件的地方跟非root用户有不一致的地方:

//非root

Scan this dir for additional .ini files => (none)
Additional .ini files parsed => (none)

//root
Scan this dir for additional .ini files => /etc/php.d
Additional .ini files parsed => /etc/php.d/curl.ini,
......
命名加载的是一样的配置文件怎么加载之后的内容就不一样呢?
搜了半天,知道了报的错里面有部分是跟这个有关系的,但是这个在哪里修改搜了老久也没有搜到。

忽然想到root用户和非root用户使用的php可执行文件是不一致的

root => /usr/bin/php
非root => /usr/local/bin/php

尝试着对这两个文件使用了php -v,结果下了我一跳,root用户的版本是5.3.3,非root用户是5.4.6,呵呵,我就呵呵了,谁部署的环境~,坑人啊。

尝试着将原有/usr/bin/php备份后,复制/usr/local/bin/php过来覆盖掉,在使用php -v发现版本一致了,也不报错了,再次去执行php protoc-php.php -n --psr dmp.proto,发现all is well,至此问题解决。

纠结了半天,结果就是版本的问题。

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/001c3cce8925b23469bd37de8ed5c559.html