This problem is also posted in the following link. I double post this since I think I need help from both the database and webserver fellow friends.
After I downgraded my php from 5.3 to 5.2, php scirpts cannot connect to MySql server. I'm not sure what part of the configurations that I need to modify.
Other than that, I can run a php scripts on my Apache sever, I can go to MySql database and do queries.
I use Apache 2.2.14, PHP 5.2.12, and MySql 5.1.41-community.
I double checked my PHP.ini and httpd.conf files and found nothing wrong. Or am I wrong?
I found out that when I executed the php script using php.exe, it ran fine as oppose through Apache server. Apache puked the following message using browser pop up:
httpd.exe - Application Error The instrunction at "xxxxxxx" reference memory at "xxxxx". The memory could not be "read" Click on OK to terminate the program Click on CANCEL to debug the program
Thus the problem lies between PHP5.2 and Apache 2.2.14 when MySql is in the middle. The script is just a simple query:
$con = mysql_connect("localhost","root","xxxxx");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("test", $con);
$result = mysql_query("SELECT * FROM name");
while($row = mysql_fetch_array($result))
{
echo $row['id'] . " " . $row['name'];
echo "<br />";
}
mysql_close($con);
Then when I revert back PHP to 5.3, the problem's gone.
The following is myphpinfo that could help introduce the problem:
Apache Environment Variable Value HTTP_HOST serenity HTTP_USER_AGENT Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 (.NET CLR 3.5.30729) HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 HTTP_ACCEPT_LANGUAGE en-us,en;q=0.5 HTTP_ACCEPT_ENCODING gzip,deflate HTTP_ACCEPT_CHARSET ISO-8859-1,utf-8;q=0.7,*;q=0.7 HTTP_KEEP_ALIVE 300 HTTP_CONNECTION keep-alive HTTP_COOKIE PHPSESSID=1gq0b4r8bg2p0qdrf1clmja504 HTTP_CACHE_CONTROL max-age=0 PATH C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\autodesk shared\;c:\program files\jzip;C:\oraclexe\app\oracle\product\10.2.0\server\OCI\lib\MSVC;C:\instantclient_10_2;C:\oraclexe\app\oracle\product\10.2.0\server\OCI\include;C:\oraclexe\app\oracle\product\10.2.0\server\OCI\lib\MSVC\vc71;;C:\Program Files\GNU\GnuPG;C:\Program Files\MySQL\MySQL Server 5.1\bin;C:\Program Files\Apache Software Foundation\Apache2.2\bin;C:\PHP;C:\Program Files\TSE\Regular Expression Component Library Vc9\Dll;C:\Program Files\CMake 2.8\bin;C:\Program Files\pcre-8.00\lib\Debug;C:\PHP\ext\;C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\PHP_Debug-1.0.3 SystemRoot C:\WINDOWS COMSPEC C:\WINDOWS\system32\cmd.exe PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PHP WINDIR C:\WINDOWS SERVER_SIGNATURE no value SERVER_SOFTWARE Apache/2.2.14 (Win32) PHP/5.2.12 SERVER_NAME serenity SERVER_ADDR 192.168.1.2 SERVER_PORT 80 REMOTE_ADDR 192.168.1.2 DOCUMENT_ROOT C:/Program Files/Apache Software Foundation/Apache2.2/ SERVER_ADMIN sXXXXXXXX@gmail.com SCRIPT_FILENAME C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/phpinfo.php REMOTE_PORT 1236 GATEWAY_INTERFACE CGI/1.1 SERVER_PROTOCOL HTTP/1.1 REQUEST_METHOD GET QUERY_STRING no value REQUEST_URI /info SCRIPT_NAME /info PHP Version 5.2.12 System Windows NT SERENITY 5.1 build 2600 Build Date Dec 16 2009 17:01:16 Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--enable-debug-pack" "--with-snapshot-template=d:\php-sdk\snap_5_2\vc6\x86\template" "--with-php-build=d:\php-sdk\snap_5_2\vc6\x86\php_build" "--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared" "--without-pi3web" Server API Apache 2.0 Handler Virtual Directory Support enabled Configuration File (php.ini) Path C:\WINDOWS Loaded Configuration File C:\WINDOWS\php.ini Scan this dir for additional .ini files (none) additional .ini files parsed (none) PHP API 20041225 PHP Extension 20060613 Zend Extension 220060519 Debug Build no Thread Safety enabled Zend Memory Manager enabled IPv6 Support enabled Registered PHP Streams php, file, data, http, ftp, compress.zlib Registered Stream Socket Transports tcp, udp Registered Stream Filters convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, zlib.* MySQL MySQL Support enabled Active Persistent Links 0 Active Links 0 Client API version 5.1.41 Directive Local Value Master Value mysql.allow_persistent On On mysql.connect_timeout 60 60 mysql.default_host no value no value mysql.default_password no value no value mysql.default_port no value no value mysql.default_socket no value no value mysql.default_user no value no value mysql.max_links Unlimited Unlimited mysql.max_persistent Unlimited Unlimited mysql.trace_mode Off Off
Does anyone here with PHP, MySql, and Apache group have experience in flipping PHP version back and forth?
Best regards,
ethereal1m
This post has been edited by ethereal1m: 20 January 2010 - 10:42 PM

New Topic/Question
Reply


MultiQuote



|