How to install php mysql extension in centos: first enter the php source code directory; then enter the mysql extension source code directory to be added; then call phpize in the compiled php; finally put "mysql.so" Just go to the default php extension directory.
Recommended: "PHP Video Tutorial" "centos Tutorial"
Centos installs the mysql extension of php
After installing apache2 php5, now I want to install mysql5 for fun.
After installing mysql5 from the source code, I found that I wanted to add a new extension to PHP on Linux. Unlike on Windows, just remove the semicolon comment~
I searched a lot of information on the Internet , finally got it done, close up the diary to express congratulations.
Basic steps for adding an extension:
1. Enter the php source code directory: # cd /usr/ChenShao/php-5.3.1/
2. Then enter the Added mysql extension source code directory: # cd ext/mysql/
2. Call phpize in the compiled php: # /usr/local/php5/bin/phpize
3. Then configure: # ./configure --with-php-config=/usr/local/php5/bin/php-config --with-mysql=/usr/local/mysql
(/usr/local /mysql is the installation directory of mysql)
4. make && make install
5. After compilation, mysql.so is automatically placed in the default php extension directory (phpinfo can view it, I is /usr/local/php5/lib/php/extensions/no-debug-zts-20090626), then modify php.ini and remove the semicolon in front of ;extension=php_mysql.so.
However, one thing to note is that the name of the generated module is mysql.so, which is inconsistent with the name of php_mysql.so in php.ini. Mysql.so must be renamed to php_mysql.so. Remember~!
6. Restart apache: # service httpd restart
Special note: If step 3 is passed, but an error is reported in step 4, it is likely to be a source code problem. I started from php After downloading a new copy of .net, I compiled it again and it passed.
The above is the detailed content of centos install php mysql extension. For more information, please follow other related articles on the PHP Chinese website!

CentOS needs alternatives because CentOSStream no longer provides long-term support. Alternative options include: 1. RockyLinux, which provides 10 years of life cycle support, suitable for users who need stability. 2.AlmaLinux also provides 10 years of support and has strong community support. 3. OracleLinux, provides RHEL-compatible version, and flexible life cycle management.

The end of CentOS has had a significant impact on users, with users having the option of RHEL, AlmaLinux, Debian or Ubuntu as alternatives. 1. The migration cost is high, requiring time and money. 2. Community division affects open source projects. 3.RHEL provides commercial support, but it is costly. 4.AlmaLinux is similar to CentOS and has low migration costs. 5. Debian and Ubuntu need more time to adapt.

CentOS is suitable as an enterprise-class server operating system because it is stable, secure and free. 1) It is based on RHEL and provides high compatibility with RHEL. 2) Use yum for package management to ensure that the software is easy to install and update. 3) The community regularly releases security patches, with a support cycle of up to 10 years.

The reason why CentOS stopped maintaining is RedHat's strategic change. User response strategies include: 1. Migrating to other distributions, such as UbuntuServer, Debian or RockyLinux; 2. Continue to use CentOS7 until June 2024; 3. Turning to CentOSStream; 4. Build solutions, such as custom distributions based on RHEL or using container technology.

RedHatendedsupportforCentOStoshifttowardsacommerciallyfocusedmodelwithCentOSStream.1)CentOStransitionedtoCentOSStreamforRHELdevelopment.2)ThisencourageduserstomovetoRHEL.3)AlternativeslikeAlmaLinux,RockyLinux,andOracleLinuxemergedasreplacements.

CentOS is an open source operating system based on RedHatEnterpriseLinux, suitable for server environments. 1. Select the appropriate media and options during installation and configure network, firewall and user permissions. 2. Use useradd, usermod and systemctl commands to manage users and services, and update software packages regularly. 3. Basic operations include using yum installation software and systemctl management services, and advanced features such as SELinux to enhance security. 4. Check the system log to solve common errors. Optimizing performance requires monitoring resources and cleaning of unnecessary files.

CentOS is the first choice for server and enterprise environments for its superior security, stability and performance. 1) Security provides forced access control through SELinux to improve system security. 2) Stability is supported by the LTS version for up to 10 years to ensure the stability of the system. 3) Performance significantly improves system response speed and resource utilization by optimizing kernel and system configuration.

CentOS alternatives should have the characteristics of stability, compatibility, community support and package management. 1.AlmaLinux provides 10 years of support, 2. RockyLinux is initiated by the founder of CentOS to ensure compatibility with CentOS. Migration cost and performance optimization should be considered when choosing.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.
