I just got hit with the weirdest bug, and I’m not sure if the problem lies with Apache, MySQL or something else. At the moment it looks like some sort of a conflict between PDO and my .htaccess files.
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, though it probably has nothing to do with Apache. I’m just trying to figure out what’s going on at this point. Have you heard of PDO-.htaccess file conflicts before?
$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/jinxedguy2/public_html';
$BaseURL = 'http://www.jinx.org';
break;
case 'Darwin':
// Just some code for my local includes...
break;
default:
break;
}
include ($BaseINC."/2B/dbc.php");