![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Web Design & Programming Discussion of web design, and server-side & client-side scripting |
![]() |
|
|
Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Oct 2005
Posts: 12
OS: Win98 and XP
|
PHP/MySQL/Apache Connection Problems (10061)
I am having the following problem with the following configuration:
PHP 5.0.2 MySQL 4.0.20d Apache 1.3.33 Windows XP Professional PHP is working, as demonstrated by the phpinfo script I have run in the browser. (<?php phpinfo() ?> )MySQL will work fine from the command line, and starts as a service in Windows. Apache is working, and will load my PHP pages, as well as html pages. However, when I try to use PHP to access MySQL, I get the following error “Cannot connect to the database server on ‘localhost’ (10061)”. I will walk through the steps I had to take to configure the server. 1. Installed MySQL 4.0.20d to c:\mysql a. From the command line: c:\mysql\bin\mysql -u root mysql 2. Unzipped PHP 5.0.2 to c:\php a. Copied the “php.ini-dist” file to c:\windows.3. Installed Apache 1.3.33 to c:\Apache. I did notice one thing. When I run phpinfo, under the mysql section, it lists the client API as 3.23. Does PHP5 not have support for MySQL 4.x? To further clarify, I have tried the same steps with differing combinations of PHP 4.3.9 and IIS, with the same results. The script I am using in PHP is as follows <?phpThis script works fine on remote servers, but I cannot get it to work on my local machine. Any suggestions? Thanks. Last edited by wirvin : 11-09-2005 at 09:51 AM. |
|
|
|
|
|
#2 (permalink) |
|
Registered User
|
php5 does work with mysql 4 because thats what I use.
Its probally something easy you are missing so I would go in telnet (start - run - cmd) and do telnet localhost 3306 if your on a network try: telnet internal_ip 3306 then your external ip (can be found at www.whatismyip.com ) telnet external_ip 3306 if you cant connect to any of these then your mysql server isnt running right. Is the mysqldnt.exe (something close to that) running in the process list? if you can connect to one of these and your php script cant that means your php.ini isnt correct. Heres what i have in my php.ini involving mysql. ----------------------- ;;;;;;;;;;;;;;;;;;;;;;;;; ; Paths and Directories ; ;;;;;;;;;;;;;;;;;;;;;;;;; ; Windows: "\path1;\path2" include_path = "c:\php\ext;c:\mysql\bin" extension=php_mysql.dll ----------------------- make sure you have that extension line uncommented (wihtout a ; in front the line) and make sure you have the path to mysql so it knows where to look for the database.
__________________
My new homepage: |
|
|
|
|
|
#3 (permalink) |
|
Registered User
Join Date: Oct 2005
Posts: 12
OS: Win98 and XP
|
The key seems to be adding port 3306, so I will try that. The thing that gets me is that I am running PHP4.3/MySQL 4.0/Apache 1.3.33 on another (Windows 98SE) computer, and it is working wonderfully. The only difference is that MySQL is running as a service (mysqld-nt.exe) on the XP machine, and on the Windows 98SE machine I had to copy the shortcut (mysqld.exe) to my startup folder for it to start up automatically (It also worked to start MySQL manually after startup). I haven't added the "c:\mysql\bin" to my include_path, but I didn't do that on my 98SE machine, either.
The MySQL server seems to be running fine. It does start automatically as a service in Windows XP, and I can access it from the command prompt with no problems. As I said, my PHP scripts work fine on the Apache server. The only thing I can’t do is access MySQL with PHP. Could you email me a copy of your php.ini file (wirvin74@hotmail.com) so I can see what I may have missed? I would sure appreciate it. Thanks. I do have a question about your include_path line. Did you have to move your php_mysql.dll file to the c:\windows\system32 directory for PHP startup to see it, or did adding c:\php\ext to your include_path allow startup to find that file? I had to move that file and libmysql.dll to system32 in order for PHP to startup properly. |
|
|
|
|
|
#4 (permalink) |
|
Registered User
Join Date: Dec 2004
Location: BC
Posts: 28
OS: WinXP Pro/FC2
|
I'm having the same problem on my local box and I tried everything (or so it seems) including the telnet stuff mentioned above. When I want to go to any page that does not include interaction with the database things are fine. When I try to log in or see a product, the page refreshes and remains. The product images/paths show up fine since the images from the database are being produced. This could be just a Windows thing because I don't have this sort of problem with Fedora Core/Linux.
|
|
|
|
![]() |
| Thread Tools | |
|
|