Jump to content

Recommended Posts

Posted

okay i have a few problems with my script i am creating to help in tracking donations.

 

 

The problem is when users try to register they get the following error

 

>Warning: main(): open_basedir restriction in effect. File(/config/config.php) is not within the allowed path(s): (/home/username:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/username/public_html/donations/scripts/forms/purchase_info_final.php on line 2

Warning: main(/config/config.php): failed to open stream: Operation not permitted in /home/username/public_html/donations/scripts/forms/purchase_info_final.php on line 2

Fatal error: main(): Failed opening required '/config/config.php' (include_path='.:/usr/local/lib/php:/usr/lib/php') in /home/username/public_html/donations/scripts/forms/purchase_info_final.php on line 2

 

the problem is that my general config for the entire script resides in one folder and cannot be access by the script.

 

If i have it like

 

>require_once("config/config.php");

 

then i trys and goes to the folder within were that script is located

 

but when i try to use the general fall back to root web method it does not work

 

>require_once("/config/config.php");

 

i get the error above, and i dont want to move the config file as when i decide to publish it and make it avalible to the general popualtion i dont want to edit multiple config files across the site with the same info

 

any help would be appreciated

 

thanks

Posted

You do not have permission to access /config/config.php on the server.

 

You should use /home/username/public_html/config/config.php as the full path. where username is your cpanel username.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...