Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #7367 > unrolled thread
| Started by | Markus Grob <snoopy@ilnet.ch> |
|---|---|
| First post | 2012-10-28 17:30 +0100 |
| Last post | 2012-11-01 00:56 +0100 |
| Articles | 14 — 7 participants |
Back to article view | Back to comp.lang.php
cant use mysql_connect Markus Grob <snoopy@ilnet.ch> - 2012-10-28 17:30 +0100
Re: cant use mysql_connect "J.O. Aho" <user@example.net> - 2012-10-28 17:44 +0100
Re: cant use mysql_connect Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-29 04:16 +0100
Re: cant use mysql_connect "J.O. Aho" <user@example.net> - 2012-10-29 07:34 +0100
Re: cant use mysql_connect Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-29 14:23 +0100
Re: cant use mysql_connect The Natural Philosopher <tnp@invalid.invalid> - 2012-10-29 11:24 +0000
Re: cant use mysql_connect Luuk <luuk@invalid.lan> - 2012-10-28 17:51 +0100
Re: cant use mysql_connect Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-28 20:21 +0100
Re: cant use mysql_connect "J.O. Aho" <user@example.net> - 2012-10-29 07:39 +0100
Re: cant use mysql_connect Markus Grob <snoopy@ilnet.ch> - 2012-10-30 22:58 +0100
Re: cant use mysql_connect Jerry Stuckle <jstucklex@attglobal.net> - 2012-10-30 19:18 -0400
Re: cant use mysql_connect "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-10-31 10:07 +0100
Re: cant use mysql_connect "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-10-31 10:15 +0100
Re: cant use mysql_connect Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-11-01 00:56 +0100
| From | Markus Grob <snoopy@ilnet.ch> |
|---|---|
| Date | 2012-10-28 17:30 +0100 |
| Subject | cant use mysql_connect |
| Message-ID | <k6jmij$jt1$1@dont-email.me> |
Hello together I have changed to Apache 2.4 with PHP 5.4 and MySQL 5.5. MySQL is running and all databases were imported from the earlier version. Apache is running and php_info gives me the hint, that mysqlnd was found: PHP Version 5.4.4 System Windows NT KRWM0023 6.1 build 7601 (Windows 7 Enterprise Edition Service Pack 1) i586 Build Date Jun 13 2012 21:17:57 Compiler MSVC9 (Visual C++ 2008) Architecture x86 Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--disable-isapi" "--enable-debug-pack" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=C:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=C:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8-11g=C:\php-sdk\oracle\instantclient11\sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet" "--with-mcrypt=static" "--disable-static-analyze" "--with-pgo" Server API Apache 2.4 Handler Apache Lounge Virtual Directory Support enabled Configuration File (php.ini) Path C:\Windows ... mysqlnd mysqlnd enabled Version mysqlnd 5.0.10 - 20111026 - $Id: b0b3b15c693b7f6aeb3aa66b646fee339f175e39 $ Compression supported SSL supported But if I now try to connect to the database, pypmyadmin tells me, that mysql can't be found: Cannot load mysql extension. My one site tells me the same: Fatal error: Call to undefined function mysql_error() in... netstat tells me, that mysql is waiting on 3306. Can someone gives me a hint? Thank you from Switzerland, Markus
[toc] | [next] | [standalone]
| From | "J.O. Aho" <user@example.net> |
|---|---|
| Date | 2012-10-28 17:44 +0100 |
| Message-ID | <af55o8FkjmpU1@mid.individual.net> |
| In reply to | #7367 |
Markus Grob wrote: > Hello together > > I have changed to Apache 2.4 with PHP 5.4 and MySQL 5.5. MySQL is running and > all databases were imported from the earlier version. > Apache is running and php_info gives me the hint, that mysqlnd was found: > > PHP Version 5.4.4 > System Windows NT KRWM0023 6.1 build 7601 (Windows 7 Enterprise Edition Service Pack 1) i586 > mysqlnd enabled > > But if I now try to connect to the database, pypmyadmin tells me, that mysql > can't be found: Cannot load mysql extension. phpmyadmin uses the mysql extension, not the mysqlnd, so you need to find a compiled mysql extension for your version of PHP (usually a lot easier if you use Linux/BSD as your server OS, for then you generally get everything you need at once and less risk for backdoors in modules). -- //Aho
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2012-10-29 04:16 +0100 |
| Message-ID | <1944408.oD1fHKOdpR@PointedEars.de> |
| In reply to | #7368 |
J.O. Aho wrote: > Markus Grob wrote: >> I have changed to Apache 2.4 with PHP 5.4 and MySQL 5.5. MySQL is running >> and all databases were imported from the earlier version. >> Apache is running and php_info gives me the hint, that mysqlnd was found: >> >> PHP Version 5.4.4 >> System Windows NT KRWM0023 6.1 build 7601 (Windows 7 Enterprise >> Edition Service Pack 1) i586 >> mysqlnd enabled >> >> But if I now try to connect to the database, pypmyadmin tells me, that >> mysql can't be found: Cannot load mysql extension. > > phpmyadmin uses the mysql extension, not the mysqlnd, so you need to find > a compiled mysql extension for your version of PHP (usually a lot easier > if you use Linux/BSD as your server OS, for then you generally get > everything you need at once and less risk for backdoors in modules). Utter nonsense. phpMyAdmin is fully capable of using the much safer mysqli extension, which is used by the mysqlnd extension: <http://wiki.phpmyadmin.net/pma/mysqli> (Never trust advice given by pseudo-anonymous or address-munging people.) PointedEars -- Anyone who slaps a 'this page is best viewed with Browser X' label on a Web page appears to be yearning for the bad old days, before the Web, when you had very little chance of reading a document written on another computer, another word processor, or another network. -- Tim Berners-Lee
[toc] | [prev] | [next] | [standalone]
| From | "J.O. Aho" <user@example.net> |
|---|---|
| Date | 2012-10-29 07:34 +0100 |
| Message-ID | <af6maoFlumU1@mid.individual.net> |
| In reply to | #7378 |
Thomas 'PointedEars' Lahn wrote: > J.O. Aho wrote: > >> Markus Grob wrote: >>> I have changed to Apache 2.4 with PHP 5.4 and MySQL 5.5. MySQL is running >>> and all databases were imported from the earlier version. >>> Apache is running and php_info gives me the hint, that mysqlnd was found: >>> >>> PHP Version 5.4.4 >>> System Windows NT KRWM0023 6.1 build 7601 (Windows 7 Enterprise >>> Edition Service Pack 1) i586 >>> mysqlnd enabled >>> >>> But if I now try to connect to the database, pypmyadmin tells me, that >>> mysql can't be found: Cannot load mysql extension. >> >> phpmyadmin uses the mysql extension, not the mysqlnd, so you need to find >> a compiled mysql extension for your version of PHP (usually a lot easier >> if you use Linux/BSD as your server OS, for then you generally get >> everything you need at once and less risk for backdoors in modules). > > Utter nonsense. phpMyAdmin is fully capable of using the much safer mysqli > extension, which is used by the mysqlnd extension: I stand corrected in this matter (haven't used phpmyadmin for years and back then it didn't support mysqli and it was prone to a lot of security issues, which it is still), and it's quite unnecessary to make accusations against a person, no matter how subtitle it is. But still, the OP will need to install the mysql extension >>> My one site tells me the same: >>> Fatal error: Call to undefined function mysql_error() in... Even if he gets his phpmyadmin to work, his site will not. Of course he can rewrite it, but I guess he rather gets it up and running now and not next year. -- //Aho
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2012-10-29 14:23 +0100 |
| Message-ID | <2044603.uqJOsAjgBC@PointedEars.de> |
| In reply to | #7379 |
J.O. Aho wrote: > Thomas 'PointedEars' Lahn wrote: >> J.O. Aho wrote: >>> phpmyadmin uses the mysql extension, not the mysqlnd, so you need to >>> find a compiled mysql extension for your version of PHP (usually a lot >>> easier if you use Linux/BSD as your server OS, for then you generally >>> get everything you need at once and less risk for backdoors in modules). >> >> Utter nonsense. phpMyAdmin is fully capable of using the much safer >> mysqli extension, which is used by the mysqlnd extension: > > I stand corrected in this matter (haven't used phpmyadmin for years and > back then it didn't support mysqli and it was prone to a lot of security > issues, which it is still), and it's quite unnecessary to make accusations > against a person, no matter how subtitle it is. phpMyAdmin has supported mysqli ever since mysqli came about (PHP 5.0, 2004). (That was *8 years* ago.) <https://github.com/phpmyadmin/history/blob/master/ChangeLogs/ChangeLog-2004> <http://www.php.net/manual/en/mysqli.overview.php> > But still, the OP will need to install the mysql extension No, they will not, and they should not. It is deprecated for a reason. > >>> My one site tells me the same: > >>> Fatal error: Call to undefined function mysql_error() in... > > Even if he gets his phpmyadmin to work, his site will not. > Of course he can rewrite it, but I guess he rather gets it up and running > now and not next year. FUD. Go away, and take your address-munged nonsense with you. PointedEars -- Sometimes, what you learn is wrong. If those wrong ideas are close to the root of the knowledge tree you build on a particular subject, pruning the bad branches can sometimes cause the whole tree to collapse. -- Mike Duffy in cljs, <news:Xns9FB6521286DB8invalidcom@94.75.214.39>
[toc] | [prev] | [next] | [standalone]
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Date | 2012-10-29 11:24 +0000 |
| Message-ID | <k6lp25$u1h$1@news.albasani.net> |
| In reply to | #7378 |
On 29/10/12 03:16, Thomas 'PointedEars' Lahn wrote: > > > (Never trust advice given by pseudo-anonymous or address-munging people.) > Well that's both of us fucked then, isn't it? > > PointedEars > ^^^^^^^^^^^^^^^ -- Ineptocracy (in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
[toc] | [prev] | [next] | [standalone]
| From | Luuk <luuk@invalid.lan> |
|---|---|
| Date | 2012-10-28 17:51 +0100 |
| Message-ID | <ed40m9-pjb.ln1@luuk.invalid.lan> |
| In reply to | #7367 |
On 28-10-2012 17:30, Markus Grob wrote: > Hello together > > I have changed to Apache 2.4 with PHP 5.4 and MySQL 5.5. MySQL is > running and all databases were imported from the earlier version. > Apache is running and php_info gives me the hint, that mysqlnd was found: > > PHP Version 5.4.4 > > System Windows NT KRWM0023 6.1 build 7601 (Windows 7 Enterprise > Edition Service Pack 1) i586 > Build Date Jun 13 2012 21:17:57 > Compiler MSVC9 (Visual C++ 2008) > Architecture x86 > Configure Command cscript /nologo configure.js > "--enable-snapshot-build" "--disable-isapi" "--enable-debug-pack" > "--without-mssql" "--without-pdo-mssql" "--without-pi3web" > "--with-pdo-oci=C:\php-sdk\oracle\instantclient10\sdk,shared" > "--with-oci8=C:\php-sdk\oracle\instantclient10\sdk,shared" > "--with-oci8-11g=C:\php-sdk\oracle\instantclient11\sdk,shared" > "--enable-object-out-dir=../obj/" "--enable-com-dotnet" > "--with-mcrypt=static" "--disable-static-analyze" "--with-pgo" > Server API Apache 2.4 Handler Apache Lounge > Virtual Directory Support enabled > Configuration File (php.ini) Path C:\Windows > > ... > > mysqlnd > mysqlnd enabled > Version mysqlnd 5.0.10 - 20111026 - $Id: > b0b3b15c693b7f6aeb3aa66b646fee339f175e39 $ > Compression supported > SSL supported > > But if I now try to connect to the database, pypmyadmin tells me, that > mysql can't be found: Cannot load mysql extension. > > My one site tells me the same: > Fatal error: Call to undefined function mysql_error() in... > > netstat tells me, that mysql is waiting on 3306. > > Can someone gives me a hint? > > Thank you from Switzerland, Markus In your php.ini, there should be a line like this: extension=mysql.so or (better) this: extension=mysqli.so or this one: extension=pdo_mysql.so all depending on how you want to connect to MySQL
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2012-10-28 20:21 +0100 |
| Message-ID | <2884606.ZZRYjR4Iyx@PointedEars.de> |
| In reply to | #7367 |
Markus Grob wrote: > I have changed to Apache 2.4 with PHP 5.4 and MySQL 5.5. MySQL is > running and all databases were imported from the earlier version. > Apache is running and php_info gives me the hint, that mysqlnd was found: You probably mean phpinfo(). > PHP Version 5.4.4 > […] > mysqlnd > mysqlnd enabled > Version mysqlnd 5.0.10 - 20111026 - $Id: > b0b3b15c693b7f6aeb3aa66b646fee339f175e39 $ > Compression supported > SSL supported > > But if I now try to connect to the database, pypmyadmin tells me, that > mysql can't be found: Cannot load mysql extension. > > My one site tells me the same: > Fatal error: Call to undefined function mysql_error() in... > > netstat tells me, that mysql is waiting on 3306. The problem is (obviously) not that your MySQL server is not running or not responding. The problem is (obviously) that PHP's mysqlnd (MySQL Native Driver) extension does not provide the obsolete, insecure mysql_* functions. It uses features provided by other MySQL extensions, mysqli or PDO MySQL, instead. RTFM: <http://www.php.net/manual/en/mysqlnd.overview.php> PointedEars -- When all you know is jQuery, every problem looks $(olvable).
[toc] | [prev] | [next] | [standalone]
| From | "J.O. Aho" <user@example.net> |
|---|---|
| Date | 2012-10-29 07:39 +0100 |
| Message-ID | <af6mlfFo9eU1@mid.individual.net> |
| In reply to | #7367 |
Markus Grob wrote:
> Hello together
>
> I have changed to Apache 2.4 with PHP 5.4 and MySQL 5.5. MySQL is running and
> all databases were imported from the earlier version.
> Apache is running and php_info gives me the hint, that mysqlnd was found:
>
> PHP Version 5.4.4
> System Windows NT KRWM0023 6.1 build 7601 (Windows 7 Enterprise Edition
>
> But if I now try to connect to the database, pypmyadmin tells me, that mysql
> can't be found: Cannot load mysql extension.
>
> My one site tells me the same:
> Fatal error: Call to undefined function mysql_error() in...
>
> netstat tells me, that mysql is waiting on 3306.
>
> Can someone gives me a hint?
For the phpmyadmin http://www.phpmyadmin.net/documentation :
$cfg['Servers'][$i]['extension'] string
What php MySQL extension to use for the connection. Valid options are:
mysql : The classic MySQL extension.
mysqli : The improved MySQL extension. This extension became available
with PHP 5.0.0 and is the recommended way to connect to a server running MySQL
4.1.x or newer.
For your site, either rewrite it to not use the mysql extension or download it
from a shady website which claims it's build for the PHP version you installed
and hope it hasn't some nasty backdoor (Recommendation would be that you used
a operating system which provides php and all the extensions without requiring
you to go to 3rd party pages).
--
//Aho
[toc] | [prev] | [next] | [standalone]
| From | Markus Grob <snoopy@ilnet.ch> |
|---|---|
| Date | 2012-10-30 22:58 +0100 |
| Message-ID | <k6piis$ren$1@dont-email.me> |
| In reply to | #7367 |
Markus Grob wrote: > But if I now try to connect to the database, pypmyadmin tells me, that > mysql can't be found: Cannot load mysql extension. I have read all the postings and now, I don't know, what I should do. I can rewrite my code, to use the mysqlnd locally, but I don't know, if normal webservers could use the new code. Will this normally be? How can I find it out? The php_mysql.dll and php_mysqli.dll are in the /ext directory and I have pointed to them in the php.ini: ... extension_dir = "C:\Program Files (x86)\php\ext" ... [PHP_MYSQL] extension=php_mysql.dll [PHP_MYSQLI] extension=php_mysqli.dll What special is, phpinfo tells me, that apache thinks, that the php.ini is in c:7windows, but this isn't true. It is in the php dir: C:\Program Files (x86) Could it be, that the problem is coming from the "Program Files (x86)" path? Greetings from Switzerland, Markus
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2012-10-30 19:18 -0400 |
| Message-ID | <k6pn8q$nrh$1@dont-email.me> |
| In reply to | #7403 |
On 10/30/2012 5:58 PM, Markus Grob wrote: > Markus Grob wrote: > >> But if I now try to connect to the database, pypmyadmin tells me, that >> mysql can't be found: Cannot load mysql extension. > > I have read all the postings and now, I don't know, what I should do. I > can rewrite my code, to use the mysqlnd locally, but I don't know, if > normal webservers could use the new code. Will this normally be? How can > I find it out? > > The php_mysql.dll and php_mysqli.dll are in the /ext directory and I > have pointed to them in the php.ini: > > ... > extension_dir = "C:\Program Files (x86)\php\ext" > ... > [PHP_MYSQL] > extension=php_mysql.dll > [PHP_MYSQLI] > extension=php_mysqli.dll > > > What special is, phpinfo tells me, that apache thinks, that the php.ini > is in c:7windows, but this isn't true. It is in the php dir: > C:\Program Files (x86) > > Could it be, that the problem is coming from the "Program Files (x86)" > path? > > Greetings from Switzerland, Markus It sounds like you're not using the php.ini file you think you're using. phpinfo() shows the one that's actually being used; if that file doesn't exist, PHP will use a default php.ini file. You need to put your php.ini file where phpinfo() says it should be (or you could modify the Windows registry to change the location to wherever you want, but I recommend the former). Pretty much all hosts support mysql and mysqli drivers; not everyone supports mysqlnd. You have a choice of using mysql, which will still be supported for some time. Or, if you're going to rewrite your code, I recommend you use the mysqli driver. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
| From | "M. Strobel" <sorry_no_mail_here@nowhere.dee> |
|---|---|
| Date | 2012-10-31 10:07 +0100 |
| Message-ID | <afc83dF98cnU1@mid.uni-berlin.de> |
| In reply to | #7403 |
Am 30.10.2012 22:58, schrieb Markus Grob: > Markus Grob wrote: > >> But if I now try to connect to the database, pypmyadmin tells me, that >> mysql can't be found: Cannot load mysql extension. > > I have read all the postings and now, I don't know, what I should do. I can rewrite > my code, to use the mysqlnd locally, but I don't know, if normal webservers could use > the new code. Will this normally be? How can I find it out? > Trying to sum up the driver thing, see http://www.php.net/manual/en/mysqli.overview.php * mysql is an old driver and old API, not recommended * mysqli is the newer API, with the same design as mysql. Can use mysqlnd * PDO is the unified and object oriented API. Can use mysqlnd, recommended * mysqlnd is not an API, only a driver lib So your programmer's choice is between mysqli and PDO. A webspace provider only offering the mysql API should not exist anymore.
[toc] | [prev] | [next] | [standalone]
| From | "M. Strobel" <sorry_no_mail_here@nowhere.dee> |
|---|---|
| Date | 2012-10-31 10:15 +0100 |
| Message-ID | <afc8gsF9aruU1@mid.uni-berlin.de> |
| In reply to | #7405 |
Am 31.10.2012 10:07, schrieb M. Strobel: > Am 30.10.2012 22:58, schrieb Markus Grob: >> Markus Grob wrote: >> >>> But if I now try to connect to the database, pypmyadmin tells me, that >>> mysql can't be found: Cannot load mysql extension. >> >> I have read all the postings and now, I don't know, what I should do. I can rewrite >> my code, to use the mysqlnd locally, but I don't know, if normal webservers could use >> the new code. Will this normally be? How can I find it out? >> > > Trying to sum up the driver thing, see > http://www.php.net/manual/en/mysqli.overview.php > > * mysql is an old driver and old API, not recommended > * mysqli is the newer API, with the same design as mysql. Can use mysqlnd > * PDO is the unified and object oriented API. Can use mysqlnd, recommended > * mysqlnd is not an API, only a driver lib > > So your programmer's choice is between mysqli and PDO. A webspace provider only > offering the mysql API should not exist anymore. > Addition: changing the interface from mysql to mysqli is normally only a matter of adding the i ... /Str.
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2012-11-01 00:56 +0100 |
| Message-ID | <4053820.uDPMeCtHly@PointedEars.de> |
| In reply to | #7403 |
Markus Grob wrote: > Markus Grob wrote: >> But if I now try to connect to the database, pypmyadmin tells me, that >> mysql can't be found: Cannot load mysql extension. > > I have read all the postings and now, I don't know, what I should do. I > can rewrite my code, to use the mysqlnd locally, but I don't know, if > normal webservers could use the new code. Will this normally be? How can > I find it out? The extensions need to be loaded. phpinfo() can tell. > The php_mysql.dll and php_mysqli.dll are in the /ext directory and I > have pointed to them in the php.ini: > > ... > extension_dir = "C:\Program Files (x86)\php\ext" > ... > [PHP_MYSQL] > extension=php_mysql.dll > [PHP_MYSQLI] > extension=php_mysqli.dll The sections are optional (AFAIK), the `extension' directives are not. > What special is, phpinfo tells me, that apache thinks, that the php.ini > is in c:7windows, but this isn't true. It is in the php dir: > C:\Program Files (x86) Does phpinfo() say that the two extensions are loaded? (Are there any occurrences of `mysql' or `mysqli' headings in the output?) Are you sure there is only one php.ini? It matters not if you write your directives into an .ini file that is not considered by PHP in the first place. > Could it be, that the problem is coming from the "Program Files (x86)" > path? Yes. Look in the phpinfo() output where it says where the .ini files are and modify *those* files. As an alternative, you can set the PHPDIR system environment variable to your real PHP directory, then restart Apache. (This has worked for me with the PHP ISAPI module on Windows. It might also work with Apache on Windows.) I am afraid your English is not so good, therefore not well readable and understandable; it is obviously based on German sentence structure (I can tell). Why do you not post to de.comp.lang.php instead? PointedEars -- Prototype.js was written by people who don't know javascript for people who don't know javascript. People who don't know javascript are not the best source of advice on designing systems that use javascript. -- Richard Cornford, cljs, <f806at$ail$1$8300dec7@news.demon.co.uk>
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.php
csiph-web