In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
I would like to share with you how to install pdo on linux CVM. I believe most people don't know much about it, so share this article for your reference. I hope you will learn a lot after reading this article. Let's learn about it.
Preparation in advance
1. First of all, the editor uses the wdcp panel (a very well-known linux management panel in China). You can check it: Ali Cloud Linux host installs WDCP management panel.
In addition, the linux system of the editor is Centos 6.3system.
two。 Prepare xshell.
Note: the following purple code needs to be run in xshell. If you are also using Ali CVM and wdcp panel, it is recommended to copy and paste directly. If not, it can be dealt with reasonably.
1. Log in to xshell. Find any temporary directory, such as / home, and enter the following code:
Cd / home
two。 Use wget to download the official pdo package provided by php
Wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz
3. Decompress
Tar zxvf PDO_MYSQL-1.0.2.tgz
4. Go to the directory you just extracted
Cd PDO_MYSQL-1.0.2
5. Add dynamic extension to PHP with phpize
/ www/wdlinux/php/bin/phpize
Note: at this step, according to the installation location of your server php, phpize is under bin in the installation directory of php. If you execute this statement and indicate that there is no phpize, you need to install phpize (ask Baidu)
6. Compile
. / configure-with-php-config=/www/wdlinux/php/bin/php-config-with-pdo-mysql=/www/wdlinux/mysql
Pay attention to this step, modify the path of php yourself.
If you report it correctly, if there is an error in this sentence, do not do step 7 for the time being, take a look at the solution:
Configure: error: no acceptable C compiler found in $PATH
See if there is an error in the picture.
If so, you need to install gcc: the following is the installation gcc tutorial:
Install gcc
Yum-y install gcc
However, when we executed this statement, we found that it was wrong again.
The specific error report is
Error: Package: glibc-headers-2.12-1.80.el6_3.6.x86_64 (updates)
Requires: kernel-headers > = 2.2.1
Error: Package: glibc-headers-2.12-1.80.el6_3.6.x86_64 (updates)
Requires: kernel-headers
If an error occurs, here is the solution:
Open the yum configuration file
Vim / etc/yum.conf
find
Exclude=kernel*
Change to
# exclude=kernel*
Just save it.
7.make
Make
8.make install
Make install
After this execution is completed, it will appear.
It means it's a success.
9. There is also the last step, sometimes when compiling, the system will do it for you automatically, and sometimes you don't have to do it yourself.
Edit the / www/wdlinux/etc/php.ini file and add at the end
Extension=/www/wdlinux/apache_php-5.2.17/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so
Note: such a long path needs to be changed to your own. Step 7 does not have such a long list of addresses.
If this alone doesn't work, add one in front of it (this is not an order, it's php.ini)
[pdo_mysql]
Extension= "pdo_mysql.so"
10. Restart apache or nginx
Service httpd restartservice nginxd restart
Final test: phpinfo.php to see if there is pdo_mysql, not just pdo
The above is all the contents of the article "how to install pdo on linux CVM". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more 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.