Jump to content

[SOLVED] mysql_connect() errors; Linux install help


Recommended Posts

aright so a lot has changed since i last compiled a LAMP server from source and since Ubuntu 7 has screwed up the PHP5 package, this is my only option.  i've never had this much trouble compiling PHP before.  nowadays apparently PHP is no longer allowed to package a client library in the installation, and i cannot seem to get the config script to recognize the library i have installed.

checking for MySQL UNIX socket location... /tmp/mysql.sock

configure: error: Cannot find MySQL header files under yes.

Note that the MySQL client library is not bundled anymore!

why is it looking under 'yes'?  the library does exist in /usr/lib but the configure script just doesn't see it.  here's a print of my ld.so.conf file:

include /etc/ld.so.conf.d/*.conf
/usr/lib

the first line was placed there by Ubuntu.  after running ldconfig, and apachectl restart, nothing changed.  i've tried adding the /usr/lib line to the /etc/ld.so.conf.d/i486-gnu-linux file as well:

# Multiarch support
/lib/i486-linux-gnu
/usr/lib/i486-linux-gnu
/usr/lib

nothing is working!  why couldn't they just add the option to the configure script?  a --with-mysql-lib='/path/to/lib' would have been nice.  how do i solve this?

Link to comment
Share on other sites

user@host:~/php-5.2.3$ ./configure --help | grep sql

  --with-fbsql[=DIR]      Include FrontBase support. DIR is the FrontBase base directory

  --with-msql[=DIR]      Include mSQL support.  DIR is the mSQL base

  --with-mssql[=DIR]      Include MSSQL-DB support.  DIR is the FreeTDS home

  --with-mysql[=DIR]      Include MySQL support. DIR is the MySQL base directory

  --with-mysql-sock[=DIR]  MySQL: Location of the MySQL unix socket pointer.

  --with-mysqli[=FILE]    Include MySQLi support. FILE is the optional pathname

                          to mysql_config

  --enable-embedded-mysqli  MYSQLi: Enable embedded support

                          install directory, defaults to /home/db2inst1/sqllib

  --with-pdo-mysql[=DIR]    PDO: MySQL support. DIR is the MySQL base directory

  --with-pdo-pgsql[=DIR]    PDO: PostgreSQL support.  DIR is the PostgreSQL base

  --without-pdo-sqlite[=DIR]  PDO: sqlite support. DIR is the sqlite base directory, the bundled sqlite is used by default

  --with-pgsql[=DIR]      Include PostgreSQL support.  DIR is the PostgreSQL

  --without-sqlite        Do not include sqlite support.

                          Use --with-sqlite=DIR to specify DIR where

  --enable-sqlite-utf8      SQLite: Enable UTF-8 support for SQLite

i'm trying to avoid installing mysqli extension but i don't see a way around it and it may not work either...

Link to comment
Share on other sites

Sorry... you did install mysql from source as well? Everyone always seesm to have alot of trouble compiling on Ubuntu, Ive never used it myself, but it would seem to me that things don't get put where they should be.

 

I was sure I'de seen something about mysql-lib within the ./configure options. Id'e like to help more, but untill I'm at home with my debian and gentoo machines I'm a bit stuck for information.

Link to comment
Share on other sites

Gentoo is a brilliant Linux, though it can be quite a bit of upkeep. Ive used it for a number of years and have always enjoyed it.

 

Installing LAMP is as easy as....

 

sudo emerge --sync
sudo emerge -pv dev-lang/php

 

edit /etc/portage/package.use accordingly, then...

 

sudo emerge dev-lang/php

Link to comment
Share on other sites

Set the mysql and mysql socket directory with the switches on configure. Sounds like it was made with --with-mysql=yes, when it should be a path.

 

If you want it to "just work" for the time being, just set the host on any mysql_connect to 127.0.0.1. Then it will use TCP/IP instead of the socket.

 

 

What was wrong with Ubuntu's PHP build? Most distros now have a very bare bone PHP5 installation, then you have to install all the extension packages. Even FreeBSD is that way now.

Link to comment
Share on other sites

got it working on FreeBSD just fine (although with some slight database issues not related to PHPNuke).  your first distro is like an old friend... i'm just more familiar with placement on FreeBSD and i don't feel lost.  everything was compiled from source except mysql41 which was taken from pkg_add.  thanks for the help guys.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.