Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: require_once() errors
06-03-2007, 07:55 PM #1
- Join Date
- Jun 2007
- Thanked 0 Times in 0 Posts
I have made a php script for checking sure that a form is filled out correctly.
The problem the register.php that has the php script does not load it comes up with three errors and i cant seem to fix it.
I have been trying to fix the errors for 3 days and have made no head ways.
The errors are
Warning: require_once() [function.require-once]: open_basedir restriction in effect. File(/Connections/userlogin.php) is not within the allowed path(s): (/tmp:/usr/share/pear:/home/fhlinux169/m/maltmandarkblues.co.uk/user) in /home/fhlinux169/m/maltmandarkblues.co.uk/user/htdocs/Register.php on line 2
Warning: require_once(/Connections/userlogin.php) [function.require-once]: failed to open stream: Operation not permitted in /home/fhlinux169/m/maltmandarkblues.co.uk/user/htdocs/Register.php on line 2
Fatal error: require_once() [function.require]: Failed opening required '/Connections/userlogin.php' (include_path='.:/usr/share/pear-php5') in /home/fhlinux169/m/maltmandarkblues.co.uk/user/htdocs/Register.php on line 2
The line of code it fails at is
require_once('/Connections/userlogin.php'); //Connect to the SQL database
I think its a server side php setting needs changed but im not sure.
Please help guys.
06-03-2007, 08:05 PM #2
- Join Date
- Dec 2004
- In a place far, far away...
- Thanked 1,043 Times in 1,019 Posts
require and include are allowed to include files from the home directory of your site meaning it can go past the public_html folder. Try this
require_once($_SERVER['DOCUMENT_ROOT'].'Connections/userlogin.php'); //Connect to the SQL database