问题
I had both apache and mysql ok and running in xampp control panel. But then when i tried to load one of my php pages i was getting a fatal error :
Call to undefined function mysql_connect().
Upon searching about this error i came across some answers. Mostly people suggested in the file php.ini to change extension_dir = "./" to extension_dir = "C:\php\ext" and uncomment the line ;extension=php_mysql.dll.
I tried that, but now when i try to restart apache i get
error:apache shutdown unexpectedly
and in the logs it shows:
server certificate does NOT include an ID which matches the server name
Does anybody know what i am suppose to do next? I have spent hours trying to solve this problem but to no avail. Your help will be appreciated.
回答1:
I believe I got the problem solved! Because you installed the XAMPP with the PHP 7+ in it instead of PHP 5+ I am new to php as well. The crash is due to PHP 7 is not supporting mysql anymore.
https://www.apachefriends.org/download.html
You will aware that there are three different version of PHP.
To confirm, you can create a page called checking.php (the name is not important) Just write the phpinfo() code inside.
<?php
phpinfo()
?>
You can check all the details about your php version!
~~~~~~~~~~ Not an answer below ~~~~~~~~~~ That's was just my puzzle a day before. I am sorry that I am not providing solution but I am saying that I am encountering the exact same thing! It is very puzzling.
in the php.ini file
;extension=php_mysql.dll
We saw the above line such that the mysql function is not working.
remove the ;
then failed to start with the same error.
[Fri Jan 22 16:18:04.964120 2016] [ssl:warn] [pid 1188:tid 384] AH01909: www.example.com:XXXX:0 server certificate does NOT include an ID which matches the server name [Fri Jan 22 16:18:05.014120 2016] [core:warn] [pid 1188:tid 384] AH00098: pid file D:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run? [Fri Jan 22 16:18:05.104120 2016] [ssl:warn] [pid 1188:tid 384] AH01909: www.example.com:XXXX:0 server certificate does NOT include an ID which matches the server name
回答2:
I was having the same problem (server certificate does NOT include an ID which matches the server name. I don't know what the root cause is but I was able to fix it with XAMPP version 5.6-30
. Before that, I tried other versions like 7
and 1.7-4
with no success. That good version is available here.
来源:https://stackoverflow.com/questions/34643156/xampp-server-certificate-does-not-include-an-id-which-matches-the-server-name