PHP extension compiled, and encountered "PHP Startup:invalid library (maybe not a PHP library)"

Source: Internet
Author: User
Tags php and mysql php website

About the working mechanism between PHP and MySQL, today the egg hurts to consider the PHP compilation installation without adding the--with-mysql parameter, whether you can implement the mysql_connect () function.

The first compilation is simple

./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etcmake && make install

Mysql_connect () did not use, originally want to install Php-mysql yum, think for a long time no extension compiled.

And then began to toss.

CD Ext/mysql/usr/local/php/bin/phpize./configure-with-php-config=/usr/local/php/bin/php-config--WITH-MYSQL=/USR /local/mysql

Then in the configuration file php.ini add extension, decisive encounter error.

notice:php message:php warning:php Startup:invalid Library (maybe not a PHP library) '/usr/local/php/lib/php/extensio Ns/no-debug-non-zts-20090626/mysql.so ' in Unknown on line 0

Tossing the Extension,extension_dir two options, all combinations have been used. Had to on the search engine, two hours later still did not find the solution on the Internet. At this time to focus on the PHP installation, the above PHP is already a second installation. Previously only did delete the installation directory, the source package files continue to be extracted before the use.

rm-rf/usr/local/php

And then, one more time.

RM src-rf (Memory is too bad, this time forget to delete the installation directory/usr/local/php) tar zxvf php-5.x.x.tar.gzcd php-5.x.x./configure--prefix=/usr/local/php- -with-config-file-path=/usr/local/php/etcmake && make Install
CD Ext/mysql/usr/local/php/bin/phpize./configure-with-php-config=/usr/local/php/bin/php-config--WITH-MYSQL=/USR /local/mysql

The configuration file was not moved because the installation directory was not deleted.

Test, success. Suddenly feel good pits, their own pits do not remove the source code decompression package, PHP website pits do not reset some environment.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.