Skyaxe Posted June 3, 2007 Share Posted June 3, 2007 Hey guys Im making a website and i am writing a php script for a register form. The script checks for required fields if a required field is missed out then a error is generated. I think the problem might be on the server site. There errors i am getting 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 code is <?php require_once('/Connections/userlogin.php'); //Connect to the SQL database ?> Please help I have been stuck on this problem for ages Thanks Skyaxe Quote Link to comment https://forums.phpfreaks.com/topic/54111-require_once-errors/ Share on other sites More sharing options...
DLR Posted June 3, 2007 Share Posted June 3, 2007 HI there, I don't know that I have the answer you need, but some suggestions. It seems that "failed to open stream" could be the key. Is your script correct? (ie has userlogins.phpworked before? I also notice that your folder "Connections" starts with a capital (and the otheres do not) - is this correct - if not it would send the script looking for a directory that does not exist. David Quote Link to comment https://forums.phpfreaks.com/topic/54111-require_once-errors/#findComment-267507 Share on other sites More sharing options...
tarun Posted June 3, 2007 Share Posted June 3, 2007 Not Found The requested URL /Connections/userlogin.php was not found on this server. The File Has To Exists To Be Able To "Require" It - I THINK... Quote Link to comment https://forums.phpfreaks.com/topic/54111-require_once-errors/#findComment-267514 Share on other sites More sharing options...
trq Posted June 3, 2007 Share Posted June 3, 2007 Remove the opening forward slash, it looks out of place. <?php require_once 'Connections/userlogin.php'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/54111-require_once-errors/#findComment-267519 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.