-1

I don't know is this off-topic for this site but i have site that run on php and mysql. And i want to change my mysql connection to PDO.

This is my connection file that i include in every file at the begining:

session_start();
$connection = @mysql_connect("localhost", "user", "password");
$database = @mysql_select_db("pemax", $connection) or die (mysql_error());

and i added this line for PDO connection

$dbc = new PDO ("mysql:host=localhost;dbname=pemax", "user", "password");

after adding this code I could not run any of my php from browser, so I had delete code I had added but still nothing just white blank page, and I don't receive any errors.

What could problem be???

mandza
  • 330
  • 9
  • 24
  • [How to squeeze error message out of PDO?](http://stackoverflow.com/q/3726505) – Pekka Dec 05 '13 at 17:01
  • @pekka I had remowe pdo code line but I still have same problem. I can't run my php. just blank white page. is it posible that this was broke my server configuration??? – mandza Dec 05 '13 at 17:07

2 Answers2

0

It could be you maxed out the number of connections to MySQL (there's only so many connections you can make). It could be some old connections are still open so, if you can change MySQL settings, you might want to adjust the number of connections and the timeout.

How can I change the default Mysql connection timeout when connecting through python?

Community
  • 1
  • 1
Machavity
  • 30,841
  • 27
  • 92
  • 100
-1

When i was editing connection file i had opened it with Vim, like:

sudo vim connection.php

and added PDO connection code line. While saving file i had type :w! and saved the files. After that my connection file ownership and persmissions were changed to root. Becouse of that my script could not be able to execute my connection file and other files could not be able to read that file, and that was cousing white screen.

After that I had changed ownership of my connection file and now everything is working just fine.

Thank you all for your help.

mandza
  • 330
  • 9
  • 24