I'm running Wordpress on a RHEL 5 box. PHP is version 5.3.3, and we just upgraded the MySQL server on the box to 5.5.32 (up from 5.0.xx).
It seems like that upgrade went well, and Wordpress is running just fine. But what I don't understand is that PHP is continuing to report that it is using MySQL 5.0.95.
Anyone have a clue how I can tell PHP to use MySQL 5.5?
Just making my comment into answer as I added to it, it became more complete.
PHP is using 5.0.95 of the MySQL client library. PHP will not report on the version of MySQL being used on the MySQL server.
You can update your mysql client library on your PHP machine. Or better yet, you may consider re-compiling PHP with the MySQL Native Driver enabled, which will decouple you from having to have MySQL client library on your machine at all.
More info on MySQL native driver: http://www.php.net/manual/en/mysqlnd.overview.php
If you just want to upgrade your MySQL client package on RHEL 5, use RPM. I am not sure what the most recent rpm package for mysql client is named for RHEL 5, but the command would be something like this:
rpm -Uvh mysql-clientXXXX.rpm
Related
I got a PHP project which uses Medoo for accessing a database on MS SQL Server 2012. I used to test my project on the same server, but since copy-pasting through remote desktop got kinda annoying and inefficient, I wanted to move on a local system, so I installed Xampp (with PHP 5.6.19 VC11). Since I still need to use the server database, I first encountered the problem that the PDO MSSQL extension is not available anymore, and my script failed to send a query to the database. So tried using the SQLSRV 3.0 extension instead (5.4 thread-safe - why isn't there a version 5.6? Is 5.4 supposed to be forward compatible?), which still sends me an uncaught exception with message 'could not find driver', thrown from the PDO constructor and forwarded through Medoo. I'm not sure if this fails on Medoo, the driver, or something else. Moving the database to phpMyAdmin is no option... Has anyone an idea how I can solve this?
All information you need are on this this web page https://msdn.microsoft.com/en-us/library/cc296170(v=sql.105).aspx.
As you can see you need version 3.2 for PHP 5.6 support. I found download link and information about adding SQLSRV extension to php.ini for you.
https://www.microsoft.com/en-us/download/details.aspx?id=20098
https://msdn.microsoft.com/en-us/library/cc296203(v=sql.105).aspx
Finally you have to install Microsoft ODBC Driver 11 for SQL Server.
In short, download SQLSRV 3.2, add PDO extension to php.ini (choose right version for your PHP), install Microsoft ODBC Driver 11 for SQL Server on your local enviroment.
I have two RHEL servers, one to host the PHP application, one to host the MySQL server.
Database server has MySQL Enterprise version 5.6.21 installed.
While getting the application server built, I asked that the rpm MySQL-client-advanced-5.6.21-1.el6.x86_64 be installed (to match server), but the hardware people don't like this version since 5.6.27 is available which addressed some vulnerabilities.
The question is the following:
Does the mysql client version on the application server affect the database queries coming from the PHP application?
We're using PDO to connect to and query MySQL.
If we do this, does the application server even need a mysql client library?
Please let me know if I can clarify.
Thanks!
PHP uses its own library/driver to connect to MySQL databases. The MySQL-client-advanced package is just the CLI mysql client. PHP does not use this.
For PHP (and PDO), you should install php-pdo and php-mysqlnd. php-mysqlnd is the "MySQL native driver" and contains some enhancements. It also contains the mysqli class and the pdo-mysql connector.
Note: php-mysqlnd versions are unrelated to the MySQL server version.
Quote from the Mysql website
MySQL Native Driver is a replacement for the MySQL Client Library (libmysqlclient). MySQL Native Driver is part of the official PHP sources as of PHP 5.3.0.
https://dev.mysql.com/doc/apis-php/en/apis-php-mysqlnd.html
We are trying to upgrade the PHP website that connects to MYSQL DB. We are trying to use the following version of Apache, PHP,MYSQL and PHPMyadmin
PHP : 5.6.6
MYSQL : 5.6
Open SSL: v1.0.2a
Apache Server : 2.4.12
PHP MYADMIN : 4.4.1.1
PHP 5.6.13 is the latest version. New versions are PHP are released very frequently (5.6.9 -->5.6.10 --> 5.6.11 --> 5.6.13).
I am trying to check the PHP compatibility with MYSQL, Apache and PHPMyadmin. Is there any PHP/MYSQL compatibility/supported versions for upgrade.
we are trying to select the correct versions of PHP and MYSQL for the upgrade.
Thanks
Ashok
Wikipedia: XAMPP
Under Components you'll find a list of all components including PHP, apache, MySQL and phpmyadmin with version numbers included, as far as I know, they use the latest stable version of each component so you'll have a good overview of what versions to pick.
EDIT: They use the latest versions that work together, so that should do the trick of finding out what versions to use.
I'm trying to connect with Laravel 4 to an SQL Server database. I'm getting an error, but I think it's a PHP error, not a Laravel error. It says PDOException: could not find driver. I have the driver set to sqlsrv like another example in the database.php file. Like I said, I think this is a PHP error, not Laravel.
I'm on localhost on my Mac. Do I need to configure something in my php.ini file? I found another article that said I need to comment out a MySQL driver under PDO. I also couldn't find that line in my php.ini. But I need to connect to a MySQL database as well, anyway. What do I need to change in my php.ini file?
I found this line:
pdo_mysql.cache_size = 2000
But commenting it out did nothing even after restarting Apache.
The sqlsrv driver is a windows-only driver according to the PHP Manual (www.php.net/manual/en/sqlsrv.requirements.php). So you can't use that driver on Mac, Linux, Unix or any other operating system than the ones listed on that page.
I assume you are trying to connect to a remote SQL Server somewhere? If you're on Mac, then SQL Server wouldn't be running on your local machine, so I guess the first question is whether or not you have a SQL Server running somewhere.
Second, from the server that is running PHP, you would need to connect using either FreeTDS or ODBC with FreeTDS.
Since Laravel 4 uses PDO, you'll need to install FreeTDS and ODBC. Laravel 4 doesn't use the mssql PHP extension. It uses PDO, so mssql won't get you anywhere with Laravel 4.
If you're serving PHP from your Mac, I would say there are generally 4 different ways you could go:
The Easy, but costly way: Go to (www.macupdate.com/app/mac/23152/openlink-odbc-driver-for-sybase) and download and install OpenLink ODBC driver. This allows you to create new ODBC connections using the Sybase (MSSQL) driver on a XNIX machine. There's an installation walk-through here (wikis.openlinksw.com/dataspace/owiki/wiki/UdaWikiWeb/InstallSybaseExpressOSX). It comes with a 15 day trial, after which you would have to purchase it. As of this writing, it appears to cost somewhere in the range of $30 - $50 depending on the license you choose.
The harder, but free way: Follow http://blog.benjaminwalters.net/?p=10 (slightly outdated) to re-compile FreeTDS support into PHP on Mac (assuming you're using MAMP)
The far better, but also far more work way: Find a Virtual Machine Host software like VMWare Fusion and install a Linux server like Ubuntu 12.4. Make sure you install apache2 and PHP during the install process and then follow the steps here to get FreeTDS working on your new server machine.
Run PHP from the Windows Server that is running SQL Server
Milage will vary with each solution, and there is a learning curve in any case. I've been a PHP developer for a long time, and it took me days to figure out how to get connected to SQL Server for the first time from Linux. Thankfully, there are quite a few walkthroughs out there now, and FreeTDS has come a long way since that time.
Hope that helps. :)
I actually have this running on my setup. My best advice is to get on the Homebrew bus.
https://github.com/josegonzalez/homebrew-php is where you're going to want to look for installing PHP and related items. I don't remember exactly what I did but it wasn't particularly difficult.
First you'll need FreeTDS.
brew install freetds
Then, add Jose's formulas to your homebrew (instructions on the github page). After that,
brew install php5x --with-mssql
brew options php5x
if you need more extensions.
Based on Jon Watson's comment,
I've tried step 2, and it doesn't work. check my issue here https://github.com/laravel/laravel/issues/2180
Step 3 is broken link and I think it's the same with step 2.
I also tried linux ODBC driver for Laravel (there are 2, google it), both doesn't work too. Although my simple test php works in both DBLIB and ODBC (compiled using official microsoft odbc unix driver).
Step 4 definitely works, BUT you must use IIS for best stability.
That leaves step 1. OR,
Ditch Laravel4 and use good ol' AdoDB http://adodb.sourceforge.net/ which I've been using since 2006 and still working superbly (although not modern like Laravel) configure it using tutorial in http://docs.moodle.org/20/en/Installing_MSSQL_for_PHP
I wonder why they don't build sqlsrv driver for linux too....
Trying to fix the problem causing this error message, "Your PHP MySQL library version 5.1.54 differs from your MySQL server version 5.5.7. This may cause unpredictable behavior." Any help would be appreciated.
Installed on the web server - PHP version 5.3.5, Apache 2.2.3, MySQL Client API 5.1.54, MySQLi 5.1.54
MySQL 5.5 installed on seperate DB server.
Do I need to upgrade the MySQL Client API on the web server? Any ideas how?
Considering you have :
MySQL Server v 5.5
MySQL Client (the php-side library) v 5.1
You should update the client library (on the PHP side), to use a more recent version : you'll gain more by using a 5.5 server than by reverting to a 5.1, I'd say.
On the how to update the php-side component... The simplest solution is probably to update your version of PHP, I'd say -- or, if that's not enough (if PHP is compiled against the 5.1 client library) to recompile PHP yourself, against a 5.5 client library.
Anyway, as long as you don't do any strange stuff, using a 5.1 client with a 5.5 server should generally work -- that's why phpMyAdmin reports a warning, but still works ;-)
I Do not know what the hell everyone suggesting you the best method is
1.Go to https://dev.mysql.com/downloads/installer/
2.Install the mysql installer do not configure anything .It will update automatically.
3.Restart all services if you are using wamp.
4.now open phpmyadmin.
Please use wamp its easy yo use and configure.
Asif iqbal