6

Modifying the php.ini file to resolve an unwanted exception

 2 years ago
source link: https://www.codesd.com/item/modifying-the-php-ini-file-to-resolve-an-unwanted-exception.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Modifying the php.ini file to resolve an unwanted exception

advertisements

I'm in the middle of transferring my site over to another server and ran across this error when trying to load the main index file:

Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in /htdocs/www/demoportal/login.php:8 Stack trace: #0 /htdocs/www/demoportal/login.php(8): PDO->__construct('mysql:host=db2....', '???', '???') #1 /htdocs/www/demoportal/index.php(3): require('/htdocs/www/dem...') #2 {main} thrown in /htdocs/www/demoportal/login.php on line 8

The line that apparently is giving an error is the following:

$db = new PDO("mysql:host=" . $host . ";dbname=" . $database, $user, $password);

The version of PHP on my system is PHP Version 5.3.19-1~dotdeb.0.

pODeM.png

I'm not sure what I need to look for in the php.ini file to modify or edit. Any help would be appreciated.


You don't have the MySQL PDO drivers installed/loaded.

Related Articles

How to locate the php.ini file (xampp)

I am using xamppserver for PHP development and want to edit the php.ini file; where can I locate it?For Windows, you can find the file in the C:\xampp\php\php.ini-Folder (Windows) or in the etc-Folder (within the xampp-Folder). Under Linux, most dist

File too important to download to the server even when the php.ini file has changed

I have been unable to upload a (.OBJ) file to the server and get an 'Error 1' meaning that The uploaded file exceeds the upload_max_filesize directive in php.ini I got this information from this page - http://php.net/manual/en/features.file-upload.er

You can not edit the php.ini file!

I have changed the php.ini file in the location (C:\xampp\apache\bin\php.ini) for Xampp and restart the server I am sure it is the real php.ini file because I have checked with phpinfo() however my changes does not take effect! why? update: I have PH

How to correctly add the ZendFramework to the php.ini file?

The ZendFramework is uploaded in C:\phpincludes\ZendFramework I added the ZendFramework library to the php.ini file: Windows: "\path1;\path2" include_path = ".;c:\phpincludes\ZendFramework\library" and then I am calling these functions

Modify the php.ini settings without modifying the original php.ini file or by using the htaccess

The default php.ini value on my server for file uploading(upload_max_filesize, post_max_size) is 10M. I wanted to increase it to 40M. How do I do that? Method 1: I can't use. This method doesn't work in this specific case. ini_set("upload_max_filesiz

How to modify the php configuration directory of the php.ini file on a subdomain

I have a FTP access to subdomain.website.com and not to the cPanel of website.com I want to change some settings on php.ini file, but I am unable to find one. And the php info says Configuration File (php.ini) Path /usr/local/lib Loaded Configuration

How to change session_save_path in the php.ini file?

I have a shared hosting on godaddy. I tried to change session save path in php.ini file with this line, sessions.save_path = "/session" I've controlled the sessions save path with sessions.save_path() function. It returns /tmp before and after c

Accessing the php.ini file

I have problem a problem in making a php file run because of the error Cannot redeclare _pear_call_destructors() in /usr/share/pear/PEAR.php on line 777 After investigation i found that only way make it run is to make changes in PHP settings include_

How to modify my php.ini file in linux

I have a issue with my php webserver. I have done extensive research and found out that I need to remove a line from my php.ini file The line is safe_mode = "On/Off" ...see http://forum.parallels.com/showthread.php?t=113374 I have access to my l

The php.ini file does not work?

I'm taking a php course. I made a php.ini file to show errors. I have the code below on my php.index file. But instead of the error being displayed just nothing shows up. What am I doing wrong? index.php code: <?php $test="I"m a variable!&quo

Laravel 5.3 Homestead php7 reload the php.ini file

I made some changes to /etc/php/7.0/cli/php.ini on my laravel homestead machine. But I can't get it to load the new settings. Tried restarting nginx, restart php7, etc...The file /etc/php/7.0/cli/php.ini is for PHP-running trough commandline. There s

How to configure the php.ini file for mail () in MAC OS?

I'm using MAC OS and using mail() to send the student details to my mail. It does not shows any errors, but the details are not sent to mail. Is there any setup in php.ini for SMTP settings?For OSX Yosemite, this fixed me right up: ; For Unix only. Y

How to modify the eclipse.ini file from the command prompt - ubuntu

My program shows Exception : GC overhead limit exceeded . I found one solution as , to increase the eclipse heap size in eclipse.ini.I tried to open eclipse.ini from Ubuntu command prompt using the command given below sudo gedit /usr/bin/eclipse/etc/

Enable short open tag without the php.ini file

can i enable short open tag with programming without touching any configuration fileYou should be able to change it in your .htaccess file if it wasn't locked down <IfModule mod_php5.c> php_value short_open_tag 1 </IfModule> See http://php.net

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK