PHP/MySQL Installation Problem

Hello.

I just started going through the Linux installation portion of the Sitepoint book, “Build Your Own Database Driven Web Site Using PHP & MYSQL” (page 42), and I came across an error when running ‘make’ for the php installation.

I installed MySQL 5.5.8 and Apache 2.2.17. I am now trying to install PHP 5.3.4.

I successfully ran ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysqli=/usr/local/mysql/bin/mysql_config

Now when running ‘make’ I get the following at the end:


In file included from /usr/local/mysql/include/my_sys.h:47,
from /home/ikerim/Downloads/php-5.3.4/ext/mysqli/php_mysqli_structs.h:77,
from /home/ikerim/Downloads/php-5.3.4/ext/mysqli/mysqli.c:33:
/usr/local/mysql/include/my_pthread.h:829:36: error: mysql/psi/mysql_thread.h: No such file or directory
In file included from /usr/local/mysql/include/my_sys.h:47,
from /home/ikerim/Downloads/php-5.3.4/ext/mysqli/php_mysqli_structs.h:77,
from /home/ikerim/Downloads/php-5.3.4/ext/mysqli/mysqli.c:33:
/usr/local/mysql/include/my_pthread.h:836: error: expected specifier-qualifier-list before ‘mysql_cond_t’
In file included from /home/ikerim/Downloads/php-5.3.4/ext/mysqli/php_mysqli_structs.h:77,
from /home/ikerim/Downloads/php-5.3.4/ext/mysqli/mysqli.c:33:
/usr/local/mysql/include/my_sys.h:338: error: expected specifier-qualifier-list before ‘mysql_mutex_t’
/usr/local/mysql/include/my_sys.h:354: error: expected specifier-qualifier-list before ‘mysql_mutex_t’
/usr/local/mysql/include/my_sys.h:417: error: expected specifier-qualifier-list before ‘mysql_mutex_t’
In file included from /home/ikerim/Downloads/php-5.3.4/ext/mysqli/php_mysqli_structs.h:77,
from /home/ikerim/Downloads/php-5.3.4/ext/mysqli/mysqli.c:33:
/usr/local/mysql/include/my_sys.h:964:27: error: mysql/psi/psi.h: No such file or directory
In file included from /home/ikerim/Downloads/php-5.3.4/ext/mysqli/php_mysqli_structs.h:81,
from /home/ikerim/Downloads/php-5.3.4/ext/mysqli/mysqli.c:33:
/usr/local/mysql/include/m_string.h:206:26: error: mysql/plugin.h: No such file or directory
In file included from /home/ikerim/Downloads/php-5.3.4/ext/mysqli/php_mysqli_structs.h:81,
from /home/ikerim/Downloads/php-5.3.4/ext/mysqli/mysqli.c:33:
/usr/local/mysql/include/m_string.h: In function ‘lex_string_set’:
/usr/local/mysql/include/m_string.h:291: error: dereferencing pointer to incomplete type
/usr/local/mysql/include/m_string.h:292: error: dereferencing pointer to incomplete type
make: *** [ext/mysqli/mysqli.lo] Error 1

Any suggestions on how I may resolve these?

Thanks,
Ismail_K

Hi Ismail,

Is there a reason you’re compiling PHP from source and not using the one pre-packaged for your chosen distro?

What distro are you using?

Anthony.

Another option is to delete your installation and then use a free, open source preconfigured web server with PHP, MySQL and Apache like XAMPP for Windows or [URL=“http://www.mamp.info/en/index.html”]MAMP if you’re on a Mac.

This thread maybe of interest too. :slight_smile:

I’m currently running Debian Etch.

The only reason I’m compiling from source is because the book goes through the process.

The book also mentions the pre-packaged versions and states, “These prepackaged versions of software are really easy to install; unfortunately, they also limit the software configuration options available to you. For this reason—and because any attempt to document the procedures for installing the packaged versions across all popular Linux distributions would be
doomed to failure—I will instead show you how to install them manually.”

I’ll take a look at the other thread you linked to, and if I can’t figure this out soon, I’ll probably just go with XAMPP.

Thanks for the responses!

Debian Etch comes with PHP 5.2.0, MySQL 5.0.32 and Apache 2.2.3, those should be more than sufficient.

If you’re not going to compile from source, use these native packages.

Ok, I’ll try using the included packages. I thank you again for your support.

装PHP时的错误
/usr/local/mysql/include/m_string.h:291: error: dereferencing pointer to incomplete type
/usr/local/mysql/include/m_string.h:292: error: dereferencing pointer to incomplete type
make: *** [ext/mysqli/mysqli.lo] Error 1
解决办法:
mkdir /usr/local/mysql/include/mysql
ln -s /usr/local/mysql/include/* /usr/local/mysql/include/mysql/