Apache vs MySQL?

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");

Check that the /home/geobear2/public_html/2B/ folder has read permission

Thanks for the tip; I’m checking it out right now.

Wow, this is like something out of the Twlight Zone! Someone in tech support just told me that you can’t include files between CPanel accounts - even though I’ve been doing it for the last 10-15 years! I asked him to disable PDO, which will hopefully restore my sites and allow me to include files between sites once again.

Sounds like the host has changed the permissions on the folders to remove access from other accounts - so the current account would have read permission and other accounts on the server would not. This is how the folder access is supposed to be defined so it sounds like your account was originally set up incorrectly and they have now fixed it.

This has nothing whatever to do with PDO so turning that off will not change anything except your ability to use PDO.

Thanks for the tips. There was so much going on, it took me a while to sort it all out.

Anyway, I now have two plans. Plan A is to fix all my .htaccess files, get PDO re-enabled, then go back to square one and redesign my websites as standalone sites. But someone told me I could include files between sites if I had a VPS, so I’m checking that out, too.