PHPStartup: Unabletoloaddynamiclibrary_PHP tutorial

Source: Internet
Author: User
Tags mysql connect apache log
PHPStartup: Unabletoloaddynamiclibrary. Yesterday, I helped a friend configure the server and found that there was a prompt for PHPWarning: PHPStartup: Unabletoloaddynamiclibrary in the apache log. then I debugged the database connection and found that the prompt Calltou yesterday helped a friend configure the server and found PHP Warning in the apache log: PHP Startup: Unable to load dynamic library prompt, and then debug the database connection to find the prompt Call to undefined function mysql_connect () error, so that the thought is that mysql has not been loaded successfully, let's take a look at the solution.
-
-

Connection code

Echo 'A ';
$ Cn = mysql_connect ("localhost", 'www. bKjia. c0m', 'Your mysql User password') or die (mysql_error ());
If ($ cn)
{
Echo phpinfo ();
}
Else
{
Echo 'MySQL connect fail ';
}
?>

Because the server uses the secure php. ini file without error display, the errors. log file of the logs in the apache installation directory is displayed.

The following error is found:

PHP Warning: PHP Startup: Unable to load dynamic library

'D: \ myserver \ php \ ext \ php_mysql.dll '-xd5xd2xb2xbbxb5xbdxd6xb8xb6xa8xb5xc4xc4

Xa3xbfxe9xa1xa3rn in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library

'D: \ myserver \ php \ ext \ php_mysqli.dll '-xd5xd2xb2xbbxb5xbdxd6xb8xb6xa8xb5xc4

Xc4xa3xbfxe9xa1xa3rn in Unknown on line 0

[Tue Dec 31 09:05:15 2013] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined

Function mysql_connect () in E: \ www \. php on line 2, referer: www. bKjia. c0m [Tue Dec 31 09:05:16 2013] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined

Function mysql_connect () in E: \ www \ a. php on line 2, referer: http: // localhost/
[Tue Dec 31 09:05:17 2013] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined

Function mysql_connect () in E: \ www \ a. php on line 2, referer: http: // localhost/
[Tue Dec 31 09:06:04 2013] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined

Function mysql_connect () in E: \ www \ a. php on line 3, referer: http: // localhost/
[Tue Dec 31 09:06:05 2013] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined

Function mysql_connect () in E: \ www \ a. php on line 3, referer: http: // localhost/
[Tue Dec 31 09:06:05 2013] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined

Function mysql_connect () in E: \ www \ a. php on line 3, referer: http: // localhost/
[Tue Dec 31 09:06:05 2013] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined

Function mysql_connect () in E: \ www \ a. php on line 3, referer: http: // localhost/
[Tue Dec 31 09:06:06 2013] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined

Function mysql_connect () in E: \ www \ a. php on line 3, referer: www. bKjia. c0m

[Tue Dec 31 09:06:06 2013] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined

Function mysql_connect () in E: \ www \ a. php on line 3, referer: http: // localhost/

There is such a sentence in the log

PHP Startup: Unable to load dynamic library 'd: \ myserver \ php \ ext \ php_mysql.dll'

PHP Fatal error: Call to undefined function is prompted when the php_mysql file is not loaded successfully.

Mysql_connect (), which means that mysql is not connected successfully, that is, loading mysql database fails. according to the analysis, there are two possible causes:

Yes, this problem does not exist because I used to decompress this php package. 2 is a server environment variable problem. if it is an environment variable, there are two solutions.

Solution


1. add environment variables directly in windows.

2. find php5ts. dll in d: PHP and copy libmysql. dll to c:/winnt/system32 (winNT/2000 ),

WinXP/2003 is copied to c:/windows/system32.

Remember to record the apache environment after copying the file to the system directory. for example, you can test http: // localhost/a. php again.

The output is related to phpinfo. the Source www. bKjia. c0m is reprinted in the original article on this site.

For more details, see http://www.bKjia. c0m/phper/linux-php/56512.htm

Warning: PHP Startup: Unable to load dynamic library prompt, and then debug the database connection to find the prompt Call to u...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.