0
votes

I've spent the last several months upgrading my websites, including upgrading my database queries to PDO. I published a test query online a while ago and got an error message, so I checked with my webhost before wading into all the technical fixes I Googled. He said the problem was simple: PDO wasn't installed on my server.

So he installed it - and all my websites crashed.

I checked back, and another tech told me there's a conflict between PDO and a line in my .htaccess files -

php_flag magic_quotes_gpc Off

So I commented out that line. That restored things to a point, but I'm now getting this message...

Warning: include(/home/geobear2/public_html/2B/dbc.php) [function.include]: failed to open stream: Permission denied in /home/symbolos/public_html/1A/ACE.php on line 67

dbc.php is simply an included file with my database connection; all my websites include it from the main site. I checked, and it's where it's supposed to be. Actually, I get a similar error with a second included page. And here's an additional error:

Warning: include() [function.include]: Failed opening '/home/geobear2/public_html/2B/dbc.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/symbolos/public_html/1A/ACE.php on line 67

Does anyone have any idea what's going on here? Can PDO somehow disrupt include links between websites? I'm totally confused. Thanks.

P.S. I downloaded the online file that includes the database connection file. Here's the relevant code...

$path = $_SERVER['REQUEST_URI'];
$path2 = str_replace('/', '', $path);

$Section  = current(explode('/', ltrim($path, '/'), 2));  // Main line 
$Sections = array('Introduction', 'Topics', 'World', 'Ecosymbols', 'Glossary', 'Reference',  'Links', 'About', 'Search');

if ( ! in_array($Section, $Sections)) 
{ 
 // die('Invalid section: ' . $Section); 
} 

switch (PHP_OS)
{
 case 'Linux':
 $BaseINC = '/home/geobear2/public_html';
 $BaseURL = 'http://www.geobop.org';
 break;

 case 'Darwin':
 // Just some code for my local includes...
 break;

 default:
 break;
}

include ($BaseINC."/2B/dbc.php");
Sanity check: You're sure /home/geobear2/public_html/2B/dbc.php exists. Also, since you got "permission denied", if you could post the output of ls -l /home/geobear2/public_html/2B/dbc.php that would be helpful. - Two-Bit Alchemist
Yes, I went into Dreamweaver's Remote View and can actually see the file dbc.php in folder 2B, where it's always been. Sorry, I don't understand what you mean by "post the output of 1s -1, etc." I'm not familiar with that command; I'm not even sure what software program you're referring to. - David Blomstrom
I'm not all that familiar with it, but if it's a permissions error I doubt DreamWeaver is powerful enough to solve your issue. You have two options (assuming I'm right): (1.) re-enlist your tech from before, or (2.) Download PuTTY, learn how to ssh to your server, and strap in. :) - Two-Bit Alchemist
Wow, this is too bizarre - I've been wrestling with weird Apache problems for the past couple weeks, now PDO, and just now a support tech told me you can't include files between two CPanel accounts. I have a plan that lets me host several domain names on one server - but I can't include files between them...even though I've been doing it for the last ten years??? I asked my webhost to disable PDO, which caused the problem in the first place. - David Blomstrom