You are not logged in.
I just installed PHP CodeSniffer. Everything went without errors.
Now, when I try to run it from CLI:
[dagrevis@localhost php-codesniffer]$ phpcs
PHP Warning: is_file(): open_basedir restriction in effect. File(/usr/bin/../CodeSniffer/CLI.php) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/) in /usr/bin/phpcs on line 28
Warning: is_file(): open_basedir restriction in effect. File(/usr/bin/../CodeSniffer/CLI.php) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/) in /usr/bin/phpcs on line 28
What could possibly be the problem?
I checked php.ini for entry “open_basedir“ and this is what I got there:
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/
Any support is much appreciated!
Offline
open_basedir restriction in effect. File(/usr/bin/........) is not within the allowed path(s) open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/
I think you will get it now.
Offline
Thanks for you hint. I just unset `open_basedir` at all.
P.S. Sorry for late reply.
Offline
Same problem here. I don't want to unset my open_basedir just to work around this.
I've tried adding several paths to my open_basedir, including /usr/bin/, just to see if that works around the problem. It doesn't.
[dave@apollo projects]$ phpcs
PHP Warning: is_file(): open_basedir restriction in effect. File(/usr/bin/../CodeSniffer/CLI.php) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/bin/../CodeSniffer/:/usr/bin/CodeSniffer/:/usr/bin/) in /usr/bin/phpcs on line 28
PHP Stack trace:
PHP 1. {main}() /usr/bin/phpcs:0
PHP 2. is_file() /usr/bin/phpcs:28
Offline
I've tried adding several paths to my open_basedir, including /usr/bin/, just to see if that works around the problem. It doesn't.
Hey Dave,
try to add /usr/ to open_basedir, works like a charm.
Regards Senad
Offline
Confirmed that adding /usr/ to open_basedir gets rid of the error. However, I'm not going to do that. That's almost as insecure as removing open_basedir entirely.
If I could add /usr/CodeSniffer/, or /usr/bin/../CodeSniffer/ to open_basedir, I'd do it. But neither of those gets rid of the error. I think the stupid /../ in the path is causing the problems.
On the bright side, it does appear that phpcs is working. It is just spitting out these errors before it succeeds.
Offline