php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51342 Access Violation with MySQL comand
Submitted: 2010-03-21 12:30 UTC Modified: 2010-03-21 16:29 UTC
From: jon dot halling at bilnavet dot com Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5.2.13 OS: Win XP SP3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jon dot halling at bilnavet dot com
New email:
PHP Version: OS:

 

 [2010-03-21 12:30 UTC] jon dot halling at bilnavet dot com
Description:
------------
I get the error message "PHP has encountered an Access Violation at [some address]" when I execute mysql_connect() in a php-file accessed by web browsers. Same result even if the MySQL-server is shut down.

Running Win XP SP3 and all the latest patches, and running Windows built in IIS webserver, has tested multiple browsers. The php.ini is standard except for extension php_mysql.dll activated. PHP installation dir is C:\Program\PHP\ and file is located in C:\Inetpub\wwwroot\work\db_test.php (http://localhost/work/db_test.php). Have checked that all files and folders have write access.

The same file accessed from command prompt is not experiencing any problems, so I have problem generating backtrace according to your instructions. Please instruct how I can gather more information if necessary.

Test script:
---------------
echo "BOO ";
$open = mysql_connect($host, $user, $pwd);
echo "FOO";

Expected result:
----------------
BOO FOO

Actual result:
--------------
BOO PHP has encountered an Access Violation at 0183AC6A

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-21 13:59 UTC] pajoye@php.net
-Status: Open +Status: Bogus
 [2010-03-21 13:59 UTC] pajoye@php.net
Don't use libmysql from MySQL installation but the one we provide. See the countless reports here to find how to fix it (PATH).
 [2010-03-21 15:18 UTC] jon dot halling at bilnavet dot com
I already have added the dir to PATH according to instructions on http://www.php.net/manual/en/faq.installation.php#faq.installation.addtopath (linked from http://php.net/manual/en/mysql.installation.php)

This is what my PATH looks like:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program\QuickTime\QTSystem\;C:\Program\MySQL\Server\bin;C:\Program\PHP\ext;C:\Program\Delade filer\DivX Shared\;C:\Program\Delade filer\Acronis\SnapAPI\

The file php_mysql.dll in folder ext has version 5.2.13.13 (all files are from the installation package, I have not changed anything).

Is there anything more I have to do? What have I missed? Please explain.
 [2010-03-21 15:23 UTC] pajoye@php.net
'C:\Program\MySQL\Server\bin;C:\Program\PHP\ext' is totally wrong.

You have to put C:\Program\PHP\ in your PATH, not the extension_dir. Then it is exactly what you should not do, having mysql dir first in your PATH.

Do:
'C:\Program\PHP\;C:\Program\MySQL\Server\bin;'...
 [2010-03-21 16:29 UTC] jon dot halling at bilnavet dot com
Got it working, thank you! Having /ext added to PATH was a mistake by me!

Some thoughts of mine though:
- If the order of PATH entries for PHP and MySQL is important that could be better documented. The documentation (http://www.php.net/manual/en/faq.installation.php#faq.installation.addtopath) clearly states that the information shall be added to the end (placing it after MySQL entries if it already exists).
- The default extension dir in php.ini could be changed to
extension_dir = "./ext"
Since this corresponds with the file structure in the .zip installation file. This will make it work on first try rather then having to change it manually.

Thanks again for the support!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 12:01:28 2024 UTC