Magic quotes gpc off joomla 3.0 cpanel hosting
This will solve the problem of getting "Class 'PDO' not found" when you create a local php.ini file.
If you can't turn off magic quotes using the htaccess file (for reasons already given by Pete Bailey) just:
- Create a text file
- Rename it to 'php.ini'
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
extension=pdo.so
extension=pdo_mysql.so
Save it to the directory/ies in which your scripts are executing.
Update: if you want to have just one copy of the new php.ini file then add this line to your root .htaccess file:
Obviously you need to move the ini file to this location of it's not there already.
Hope that saves someone the 2 hours it's just taken me!
The php_flag and php_value inside a .htaccess file are technically correct - but for PHP installed as an Apache module only. On a shared host you'll almost never find such a setup; PHP is run as a CGI instead, for reasons related to security (keeping your server neighbours out of your files) and the way phpsuexec runs scripts as 'you' instead of the apache user.
Apache is thus correct giving you a server error: it doesn't know about the meaning of php_flag unless the PHP module is loaded. A CGI binary is to Apache an external program instead, and you can't configure it from within Apache.
Now for the good news: you can set up per-directory configuration putting there a file named 'php.ini ' and setting there your instructions using the same syntax as in the system's main php.ini. The PHP manual lists all settable directives: you can set those marked with PHP_INI_PERDIR or PHP_INI_ALL, while only the system administrator can set those marked PHP_INI_SYSTEM in the server-wide php.ini.
Note that such php.ini directives are not inherited by subdirectories, you'll have to give them their own php.ini.
I know I'm late to answer this, but I read most of the answers and while many were great, only djn actually explained why you were getting this 500 Internal Server Error.
While his explanation was 100% correct, this is a perfect example of why you should always wrap those in an
Or for older versions it would be
I try to make a habit out of always doing this so as to avoid any such 500 errors. After that, just apply what Peter Bailey said .