guyinva Posted May 2, 2008 Share Posted May 2, 2008 Hi Everyone, I have a few pages that are SSL encrypted. When I use the normal http:// protocol, my require_once()'s work fine, but when I switch to https:// they break with: Fatal error: require_once() [function.require]: Failed opening required '/home/user/docroot/dir/folder.php' (include_path='.:') in /home/user/docroot/init.php on line 9 Yes, I was too cheap to buy a multi-domain certificate, and this is on a test subdomain, so I get a warning message but the lock indicator appears OK. All my includes/requires are absolute from the OS root (or jail root in my case), so they all look like: include($_SERVER['DOCUMENT_ROOT'] . "/path/to/file.php"); I know I'm doing something wrong here, but what part of this equation is breaking my paths? Is it that I'm using absolute paths, or is it that I'm using a certificate not registered to this subdomain. Thanks for your help! Link to comment https://forums.phpfreaks.com/topic/103889-a-newbie-ssl-path-question/ Share on other sites More sharing options...
guyinva Posted May 2, 2008 Author Share Posted May 2, 2008 More info: I'm using mod_ssl/2.8.31 PHP 5.2.5 Actually, doing a test, it looks like Apache is forcing the docroot over to the domain associated with my certificate. (I didn't see this before because both domains are similar.) Is that the normal behavior? Link to comment https://forums.phpfreaks.com/topic/103889-a-newbie-ssl-path-question/#findComment-531822 Share on other sites More sharing options...
Crew-Portal Posted May 2, 2008 Share Posted May 2, 2008 when you are using SSl you are encripting the data. Your server simply cannot find the file because the SSl is not allowing the file to be opened. Link to comment https://forums.phpfreaks.com/topic/103889-a-newbie-ssl-path-question/#findComment-531911 Share on other sites More sharing options...
guyinva Posted May 2, 2008 Author Share Posted May 2, 2008 But this is because of the not-validated certificate, right? I can include/require to my hearts content when I run the same page under the authenticated domain. Maybe it's a subdomain issue. My testing site (unauthenticated) is test.mysite.com while the authenticated site is the main mysite.com domain. Link to comment https://forums.phpfreaks.com/topic/103889-a-newbie-ssl-path-question/#findComment-531941 Share on other sites More sharing options...
PFMaBiSmAd Posted May 2, 2008 Share Posted May 2, 2008 Your include()/require() is using the file system. This has nothing to do with SSL, except that your https request appears to resolve to a different DOCUMENT_ROOT folder than your http request and you are apparently trying to include a file that is in a different folder structure than what you expect. Edit: You mention different domains? Don't expect an include/require through the file system to work on a live server where the account permissions are set correctly. If you are actually trying to do an include through a http/https request, that won't include the php code in a file. It will only include any content that is output (the same as if you browsed to the file that is being included.) Link to comment https://forums.phpfreaks.com/topic/103889-a-newbie-ssl-path-question/#findComment-531948 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.