Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Im beginner in php language. in my web project i created a filepath.config.ini file which stores all file path in the website directories. for eg.
PHP
CLASS1 = bin/myclass1.php
CLASS2 = bin/myclass2.php

and im accessing those path by using:
PHP
require $_SERVER['DOCUMENT_ROOT'].'/'.GetfilePath('CLASS1');

in localhost server its working good and giving me path like this
PHP
D:/myproject/bin/myclass1.php

when i upload those file on test server im getting this open_basedir restriction error.
PHP
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/usr/local/apache/htdocs/projectfolder/bin/myclass1.php) is not within the allowed path(s): (/home/:/usr/lib/php:/tmp)

i know we can disable this restriction...but i dont know how to do that :P.
but is it good to use this server DOCUMENT_ROOT ???
or is their any alternate way to use the file path? what you people do to access those file path.
and what happen if i disable the open_basedir restriction? is it secure to do that?
please help me what to do?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900