In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces php5.6 how to install mysql extension, the article is very detailed, has a certain reference value, interested friends must read it!
Php5.6 installs the mysql extension: 1, download the source package of the extension and decompress it; 2, execute phpize;3, generate makefile, execute make and make install commands; 4, modify php.ini configuration file; 5, restart httpd service.
The operating environment of this paper: centos 7 system, php 5.6, thinkpad T480 computer.
Recently, I accidentally found an error while maintaining an old project, the error message: "Fatal error: Uncaught Error: Call to undefined function mysql_connect ()". After finding out the reason, I found that the mysql_connect module in php had been deprecated, and I didn't install the mysql extension when I was building the environment, so I made this error.
Now that we have found out the cause, it will be much more convenient to solve it. We can solve this problem by manually compiling and generating mysql.so extensions using the phpize tool.
The specific steps are as follows:
The first step is to download the source package for the pdo_mysql extension.
# wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz
And then decompress.
# tar-zxvf PDO_MYSQL-1.0.2.tgz
Enter the unzipped directory and execute phpize.
# / usr/local/php/bin/phpizeConfiguring for:PHP Api Version: 20100412Zend Module Api No: 20100525Zend Extension Api No: 220100525
Next, generate the makefile. The next two parameters must be added, but I didn't add them at first, but both of them indicated that the header files for php-config and mysql could not be found.
#. / configure-with-php-config=/usr/local/php/bin/php-config-with-pdo-mysql=/usr/local/mysql
Before make, we should also make a soft link to the header file of mysql. Because the directory was specified when mysql was installed, if you don't make a soft connection, you still can't find the header file.
# ln-s / usr/local/mysql/include/* / usr/local/include/
And then make and make install.
# make# make install
It will then be prompted as follows, meaning that the extension is installed in the following directory.
Installing shared extensions: / usr/local/php/lib/php/extensions/no-debug-zts-20100525/
Modify the php.ini file
Modify: extension_dir = "/ usr/local/php/lib/php/extensions/no-debug-zts-20100525/"
Add: extension=pdo_mysql.so
Restart httpd to reload the php configuration file
These are all the contents of the article "how to install mysql extensions in php5.6". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.