In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "how to install PHP's PDO extension in Centos". The editor shows you the operation process through an actual case. The method of operation is simple, fast and practical. I hope this article "how to install PHP's PDO extension in Centos" can help you solve the problem.
Environment:
Server system: Centos6.5 (virtual machine demonstration)
PHP package storage directory: / data/php-5.6.14/
PHP installation directory: / usr/local/php/
Mysql installation directory: / usr/local/mysql/
Operation procedure:
Through the phpinfo () function, we can check whether the server has the PDO extension installed. If the PDO extension information is not found, let's install it by the following steps: find your PHP installation package (mine is in the / data/php-5.6.14/ directory), go to the pdo_mysql directory of the PHP extension, and run the following command:
/ usr/local/php/bin/phpize
(/ usr/local/php/ is my PHP installation directory, you can modify it according to the actual situation)
After executing the above command, we will find that the configure file appears in the current pdo_msyql directory.
So we carry out the following orders:
. / configure-with-php-config=/usr/local/php/bin/php-config-with-pdo-mysql=/usr/local/mysql/
Parameter description:-with-php-config=/usr/local/php/bin/php-config specifies the configuration when installing PHP-with-pdo-MySQL=/usr/local/mysql/ specifies the location of the installation directory of the MySQL database (here, the installation directory of PHP and msyql depends on your actual situation)
Continue to compile and install:
Make & & make install
After the command is executed, the effect is as follows:
The directory sufficient for the last line, which will be used later, is where the generated pdo_mysql.so file is located:
Next, let's modify the PHP configuration file, open your php.ini file, and add a line of code:
Extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/pdo_mysql.so
(here is the pdo_mysql.so directory I demonstrated. When you set it up, add it according to your actual directory.)
Finally, save the launch and restart the service. Then use the phpinfo () function to check whether the PDO extension is installed successfully, and the results are as follows, indicating that the PDO extension is installed successfully.
This is the end of the introduction on "how to install PHP's PDO extension in Centos". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
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.