I am using a file in my main folder, httpdocs to execute this operations ( php ) on a "subdomain" folder that is outside the main folder.
The problem is I can’t copy files, delete into that folder… the following error appears:
Warning: opendir() [function.opendir]: open_basedir restriction in effect. File(../ppp) is not within the allowed path(s): in / on line 25
Warning: opendir(../ppp) [function.opendir]: failed to open dir: Operation not permitted in on line 25
As PHP warning clearly states, you have a PHP instance configured to restrict your file manipulation functions to the only allowed directories. It’s configured in
open_basedirdirective in yourphp.inifile.As PHP documentation states (about
open_basedir):The solution is rather simple. Open your PHP configuration file (in the most of Linux environments it’s stored in a
/etc/php(5?)directory and called something likephp.ini) and search foropen_basedirdirective. Its format is similar to format ofPATHenvironment variable on variety of OS’es.Hope it helps and I’d like to greet the SO community. It’s my first post, so I’ll be glad if someone points me my mistakes during answering this question. Cheers!