Improve company productivity with a Business Account.Sign Up

x
?
Solved

Linux PHP/Propel Error

Posted on 2012-12-30
11
Medium Priority
?
429 Views
Last Modified: 2013-01-20
I moved my app to another test server, this one is red hat linux.  It uses from mysql, propel and php.  I am getting this error, does anyone know how to resolve it?



An error occurred

Application error

Exception information:

Message: Unable to open PDO connection [wrapped: could not find driver]
0
Comment
Question by:Jack_son_
  • 4
  • 3
  • 2
  • +1
11 Comments
 
LVL 13

Assisted Solution

by:themrrobert
themrrobert earned 668 total points
ID: 38731833
Yes, you have to install the php-pdo files from the yum repository. I can't remember exactly it's name, but

yum install *pdo*

Should do the trick.

Also, if you search for PHP in the add/remove software program and look for PDO you will find the software you need. (or Search for pdo and look for the php one, get it? )

Have fun :)
0
 
LVL 13

Assisted Solution

by:themrrobert
themrrobert earned 668 total points
ID: 38731845
You're also going to need the driver, if it's mysql, you'll need php-mysql or similar, that should take care of you :)
0
 

Author Comment

by:Jack_son_
ID: 38731851
Great, thanks, that error is gone, but now have this one:

Message: Unable to open PDO connection [wrapped: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)]


Also, I have the db on a different server, would this be part of the problem?
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 444 total points
ID: 38731964
Yes since your error message says 'local MySQL server'.  This is the connection method I use for MySQL PDO.  Put the IP address or domain name of your remote server in as $dbhost.

$dbdsn = "mysql:dbname=$dbname;host=$dbhost";
$dbh = new PDO($dbdsn, $dbuser, $dbpass);

Open in new window

0
 
LVL 11

Assisted Solution

by:mcnute
mcnute earned 888 total points
ID: 38732240
Mysql isn't menat to support cross server mysql connections. It is certainly possible to host your db on another server, but it takes a lot more time to load information through a constellation like that (mysql on one machine, website on another).

I strongly recommend you to install a mysql server on the machine your website is running and make up a localhost db connection to avoid heavy loading times.
0
 

Author Comment

by:Jack_son_
ID: 38732397
It can't run to a backend db server?  In this case we cannot use the db on an internet facing server so it is not a choice.
0
 
LVL 11

Assisted Solution

by:mcnute
mcnute earned 888 total points
ID: 38732410
in your host variable $host try to specify the ip address of the remote server of your db and then add the port/socket like so:

http://11.123.123.45:3306

Open in new window


3306 is the standard port for mysql connections.
0
 
LVL 13

Assisted Solution

by:themrrobert
themrrobert earned 668 total points
ID: 38732416
it absolutely CAN be run as a backend server, the error you describe is because the script is trying to access the local server via the file descriptor.
you might try a different library to access mysql, or just make sure all the connection info is correct.

your question is answered above, please close this question and start a new one with the details of your current problem, that will ensure you get the best help.
0
 
LVL 11

Assisted Solution

by:mcnute
mcnute earned 888 total points
ID: 38732437
you can find out about php mysql support methods running a phpinfo(); in a info.php file. There all of the drivers for mysql connection within php are listed.
0
 
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 444 total points
ID: 38733118
No, no, I connect to MySQL servers over the network and over the internet all the time.  Many hosting companies put their databases on different machines.  You just have to set up the connections correctly.  

A MySQL server on the same machine that your code is running on can be connected thru 'localhost'.  All servers on other machines require either the IP address or the domain name (along with the username and password) to connect.
0
 
LVL 11

Accepted Solution

by:
mcnute earned 888 total points
ID: 38733129
Ok, i didn't know about that. I connected once a wordpress blog to a database on another machine and it took about three to four times loading the info out of the database into the blog as it did when the mysql server was on the same server. Maybe there is some network configuration in the mysql server to make before doing this, which I don't know of. But this constellation for me in that occasion was an aweful set up.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

608 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question