socalhockeygal Posted October 10, 2012 Share Posted October 10, 2012 Hello, I am new to the forum and do not have a whole lot of experience with coding. I was asked to manage the website for the company I work for. The website needed updating, in particular pricing for the products we sell. The way I was taught to update the site was to select a product. At the bottom of each product page there is a link to "Update product". Typically the first time I use the link, it asks me to log in, and then it takes me to an administrative page where I can change information for the product. I was working on it all day, when towards the end of the day I received this error message once I finished updating a product: Fatal error: require_once(): Failed opening required './Connections/ccgifts.php' (include_path='.:/usr/share/pear:/usr/share/php53/pear') in /webroot/c/r/creat031/primary/www/cms/index.php on line 1 It seems like it is telling me to add the include_path on line one of my index.php. And I have, but then I get error messages like this: Parse error: syntax error, unexpected T_STRING in /webroot/c/r/creat031/primary/www/cms/index.php on line 1 Please help! Usually after clicking on updating the product it takes me to the main Administrative page on what seems to be the back end of the website. Now it just gives me error messages. Thanks in advance for your help! Quote Link to comment https://forums.phpfreaks.com/topic/269324-require_once-help/ Share on other sites More sharing options...
kicken Posted October 10, 2012 Share Posted October 10, 2012 The (include_path='.:/usr/share/pear:/usr/share/php53/pear') part of the error message is just informational, it is letting you know what the include path is at the point in time when PHP tried to find that file. It's not telling you to add it to your script or change it. The issue is that for some reason PHP is unable to open the requested file. Either it can't be found (wrong path, or maybe deleted) or there is a permissions problem. The first step is to make sure the file exists. My guess would be PHP is expecting to find it at /webroot/c/r/creat031/primary/www/cms/Connections/ccgifts.php Quote Link to comment https://forums.phpfreaks.com/topic/269324-require_once-help/#findComment-1384336 Share on other sites More sharing options...
socalhockeygal Posted October 10, 2012 Author Share Posted October 10, 2012 Ok, that's another thing that I did check for. The ccgifts.php file is there and uploaded via the WS_FTP program. Quote Link to comment https://forums.phpfreaks.com/topic/269324-require_once-help/#findComment-1384337 Share on other sites More sharing options...
DarkerAngel Posted October 11, 2012 Share Posted October 11, 2012 Ok, that's another thing that I did check for. The ccgifts.php file is there and uploaded via the WS_FTP program. Does PHP have the proper permissions to access the file? Quote Link to comment https://forums.phpfreaks.com/topic/269324-require_once-help/#findComment-1384396 Share on other sites More sharing options...
MDCode Posted October 11, 2012 Share Posted October 11, 2012 You may also have an error on line one of index.php, posting the code may help for finding the solution Quote Link to comment https://forums.phpfreaks.com/topic/269324-require_once-help/#findComment-1384478 Share on other sites More sharing options...
socalhockeygal Posted October 12, 2012 Author Share Posted October 12, 2012 oh boy. now the homepage of the website is showing up as a blank page. it doesn't read any errors or anything like before. thoughts on how to fix? did all the syntax/parse errors from before cause this?? Also the code from line one is: <?php require_once('Connections/ccgifts.php'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/269324-require_once-help/#findComment-1384822 Share on other sites More sharing options...
Christian F. Posted October 13, 2012 Share Posted October 13, 2012 The "white page" syndrome is a clear indication on a fatal PHP error, with error reporting turned off. Which it should be, on a production server. You'll find the error messages in the error log. However, in this case I'm pretty sure we know the problem already, and it's the problematic require_once () statement; It will throw a fatal error if it can't include the specified file. There are no parse or syntax errors in either file, or PHP would have told you so. As Kicken already told you, PHP cannot find/read the file in question. You state that you've verified that the file is located in the defined folder, and that it exists. I don't know if you've verified if the web server has read-access to it (permissions should be 644 in the FTP client, normally), but it never hurts to double-check. Another thing that you should verify, is that the filenames are cased exactly the same. On Windows upper and lower case letters in the path and/or filename doesn't matter, but on other operating systems (like Linux) they are treated as two different characters. That's why I, and many others, recommend keeping file and folder names lower-case only. Quote Link to comment https://forums.phpfreaks.com/topic/269324-require_once-help/#findComment-1384984 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.