Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How do I add mysql to php? [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
cwc
Veteran
Veteran


Joined: 20 Mar 2006
Posts: 1402
Location: Tri-Cities, WA USA

PostPosted: Wed Jun 18, 2008 3:22 pm    Post subject: How do I add mysql to php? [SOLVED] Reply with quote

Edited after we solved the problem.
The key was to add mysl and mysqli (refer to this post) in the /etc/make.conf and

add:
dev-lang/php mysql mysqli
dev-lang/php apache2
dev-db/mysql -berkdb innodb other_use_flags
in /etc/portage/package.use

********************************************************************
I've installed apache 2 php and mysql on a testing box.
Now I'm trying to load the mysql modules with apache with no luck.

Any hints out there?

Here is my make.conf for apache.

APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias proxy"

Here is my php infro dump"

Code:

Configure Command     './configure' '--prefix=/usr/lib/php5' '--host=i686-pc-linux-gnu' '--mandir=/usr/lib/php5/man' '--infodir=/usr/lib/php5/info' '--sysconfdir=/etc' '--cache-file=./config.cache' '--disable-cli' '--with-apxs2=/usr/sbin/apxs2' '--with-config-file-path=/etc/php/apache2-php5' '--with-config-file-scan-dir=/etc/php/apache2-php5/ext-active' '--without-pear' '--disable-bcmath' '--without-bz2' '--disable-calendar' '--disable-ctype' '--without-curl' '--without-curlwrappers' '--disable-dbase' '--disable-exif' '--without-fbsql' '--without-fdftk' '--disable-filter' '--disable-ftp' '--with-gettext' '--without-gmp' '--disable-hash' '--disable-json' '--with-kerberos=/usr' '--enable-mbstring' '--with-mcrypt' '--without-mhash' '--without-msql' '--without-mssql' '--with-ncurses' '--with-openssl' '--with-openssl-dir=/usr' '--disable-pcntl' '--disable-pdo' '--without-pgsql' '--disable-posix' '--with-pspell' '--without-recode' '--disable-simplexml' '--disable-shmop' '--without-snmp' '--disable-soap' '--disable-sockets' '--without-sybase' '--without-sybase-ct' '--disable-sysvmsg' '--disable-sysvsem' '--disable-sysvshm' '--without-tidy' '--disable-tokenizer' '--disable-wddx' '--disable-xmlreader' '--disable-xmlwriter' '--without-xmlrpc' '--without-xsl' '--disable-zip' '--with-zlib' '--disable-debug' '--enable-dba' '--without-cdb' '--without-db4' '--disable-flatfile' '--with-gdbm' '--disable-inifile' '--without-qdbm' '--with-freetype-dir=/usr' '--with-t1lib=/usr' '--disable-gd-jis-conv' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--without-xpm-dir' '--with-gd' '--with-ldap' '--without-ldap-sasl' '--without-mysqli' '--with-readline' '--without-libedit' '--without-mm' '--without-sqlite'

_________________
Without diversity there can be no evolution:)


Last edited by cwc on Thu Jun 19, 2008 1:02 pm; edited 1 time in total
Back to top
View user's profile Send private message
makism
Tux's lil' helper
Tux's lil' helper


Joined: 24 Oct 2007
Posts: 85

PostPosted: Wed Jun 18, 2008 3:34 pm    Post subject: Reply with quote

as ./configure indicates, you have no support for mysql in php...
try, emerging php again, with USE="mysql mysqli"
Back to top
View user's profile Send private message
cwc
Veteran
Veteran


Joined: 20 Mar 2006
Posts: 1402
Location: Tri-Cities, WA USA

PostPosted: Wed Jun 18, 2008 6:54 pm    Post subject: I added mysql and mysqli Reply with quote

No luck.

I emerged apache again with

APACHE2_MODULES="actions alias auth_basic mysql mysqli authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias proxy"

I'm not sure what to do now. I might have to emerge php again so I get the mysql.so rather than the mysql.dll.

Hmmmm. Any other ideas?
_________________
Without diversity there can be no evolution:)
Back to top
View user's profile Send private message
tgR10
Apprentice
Apprentice


Joined: 23 Oct 2007
Posts: 262
Location: caly ten ambaras

PostPosted: Wed Jun 18, 2008 8:08 pm    Post subject: Reply with quote

Code:
equery u php|grep mysql

if it show somethink like
Code:
-mysql
-mysqli


then you need to reemerge PHP with mysql flag
as he wrote
makism wrote:
as ./configure indicates, you have no support for mysql in php...
try, emerging php again, with USE="mysql mysqli"

_________________
"bo kto ma racje ? ten kto z bliska zobaczy"
"moge nie wiedziec,wchlaniam niewiedze z malych torebek"
http://i12.tinypic.com/4pow0mu.png
http://userbar.tgr.debil.eu/userbar.jpg
Back to top
View user's profile Send private message
xtz
Apprentice
Apprentice


Joined: 29 Oct 2007
Posts: 181
Location: Singapore

PostPosted: Wed Jun 18, 2008 8:10 pm    Post subject: Reply with quote

mysql.dll :?: :!: :?:
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Wed Jun 18, 2008 8:34 pm    Post subject: Reply with quote

I would emerge -pv php and make sure that you see mysql and mysqli USE flags are turned on. Then emerge php. Emerging apache again does not affect PHP at all.

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
cwc
Veteran
Veteran


Joined: 20 Mar 2006
Posts: 1402
Location: Tri-Cities, WA USA

PostPosted: Wed Jun 18, 2008 9:33 pm    Post subject: Reply with quote

xtz wrote:
mysql.dll :?: :!: :?:


/etc/php/apache2-php5

;extension=php_ming.dll
;extension=php_msql.dll
;extension=php_mssql.dll
;extension=php_mysql.dll
;extension=php_mysqli.dll
_________________
Without diversity there can be no evolution:)
Back to top
View user's profile Send private message
cwc
Veteran
Veteran


Joined: 20 Mar 2006
Posts: 1402
Location: Tri-Cities, WA USA

PostPosted: Wed Jun 18, 2008 10:28 pm    Post subject: no luck Reply with quote

kashani wrote:
I would emerge -pv php and make sure that you see mysql and mysqli USE flags are turned on. Then emerge php. Emerging apache again does not affect PHP at all.

kashani


I set the flags and emerged php
No luck. I might have to config something.

part of my /etc/make.conf
Code:

APACHE2_MODULES="actions alias auth_basic mysql mysqli authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias proxy"
USE="apache2 cli crypt gdbm iconv ipv6 kerberos ldap ncurses nls pcre readline reflection session spell spl ssl truetype unicode xml zlib -adabas -bcmath -berkdb -birdstep -bzip2 -calendar -cdb -cgi -cjk -concurrentmodphp -ctype -curl -curlwrappers -db2 -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob -exif -fastbuild -fdftk -filter -firebird -flatfile -force-cgi-redirect -frontbase -ftp -gd -gd-external -gmp -hash -imap -inifile -interbase -iodbc (-java-external) -json -kolab -ldap-sasl -libedit -mcve -mhash -msql -mssql -mysql -mysqli -oci8 -oci8-instant-client -odbc -pcntl -pdo -pic -posix -postgres -qdbm -recode -sapdb -sharedext -sharedmem -simplexml -snmp -soap -sockets -solid -sqlite -suhosin -sybase -sybase-ct -sysvipc -threads -tidy -tokenizer -wddx -xmlreader -xmlrpc -xmlwriter -xpm -xsl -yaz -zip -zip-external tk"



_________________
Without diversity there can be no evolution:)
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Wed Jun 18, 2008 10:30 pm    Post subject: Reply with quote

what is the output of emerge -pv php and have you restarted apache since you rebuilt php?

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
zyko
l33t
l33t


Joined: 01 Jun 2008
Posts: 620
Location: Munich, Germany

PostPosted: Wed Jun 18, 2008 10:45 pm    Post subject: Reply with quote

Is APACHE2_MODULES the same as USE? Make sure to set the right USE flags for dev-lang/php in addition to APACHE2_MODULES.

What's the output of "emerge -pvt php"?
Back to top
View user's profile Send private message
cwc
Veteran
Veteran


Joined: 20 Mar 2006
Posts: 1402
Location: Tri-Cities, WA USA

PostPosted: Wed Jun 18, 2008 11:38 pm    Post subject: Reply with quote

kashani wrote:
what is the output of emerge -pv php and have you restarted apache since you rebuilt php?

kashani


Yes I've restart Apache. Here's my

# emerge -pvt php
Code:

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[ebuild   R   ] dev-lang/php-5.2.6-r1  USE="apache2 cli crypt gdbm iconv ipv6 kerberos ldap ncurses nls pcre readline reflection session spell spl ssl truetype unicode xml zlib -adabas -bcmath -berkdb -birdstep -bzip2 -calendar -cdb -cgi -cjk -concurrentmodphp -ctype -curl -curlwrappers -db2 -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob -exif -fastbuild -fdftk -filter -firebird -flatfile -force-cgi-redirect -frontbase -ftp -gd -gd-external -gmp -hash -imap -inifile -interbase -iodbc (-java-external) -json -kolab -ldap-sasl -libedit -mcve -mhash -msql -mssql -mysql -mysqli -oci8 -oci8-instant-client -odbc -pcntl -pdo -pic -posix -postgres -qdbm -recode -sapdb -sharedext -sharedmem -simplexml -snmp -soap -sockets -solid -sqlite -suhosin -sybase -sybase-ct -sysvipc -threads -tidy -tokenizer -wddx -xmlreader -xmlrpc -xmlwriter -xpm -xsl -yaz -zip -zip-external" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB
 

_________________
Without diversity there can be no evolution:)
Back to top
View user's profile Send private message
cwc
Veteran
Veteran


Joined: 20 Mar 2006
Posts: 1402
Location: Tri-Cities, WA USA

PostPosted: Wed Jun 18, 2008 11:41 pm    Post subject: setting use and apache? Reply with quote

zyko wrote:
Is APACHE2_MODULES the same as USE? Make sure to set the right USE flags for dev-lang/php in addition to APACHE2_MODULES.

What's the output of "emerge -pvt php"?

At the top of this page I've posted the Apache settings and my
I'm not sure if I need to use both. I was following a gentoo.wiki howto.
APACHE2_MODULES=" . . ."
USE=" . . . "
I also posted the emerge -pvt

Thanks to all of you for the help. I actually enjoy this. Especially when I get things to work.
_________________
Without diversity there can be no evolution:)
Back to top
View user's profile Send private message
Mad Merlin
Veteran
Veteran


Joined: 09 May 2005
Posts: 1155

PostPosted: Thu Jun 19, 2008 12:34 am    Post subject: Reply with quote

cwc wrote:
kashani wrote:
what is the output of emerge -pv php and have you restarted apache since you rebuilt php?

kashani


Yes I've restart Apache. Here's my

# emerge -pvt php
These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[ebuild R ] dev-lang/php-5.2.6-r1 USE="apache2 cli crypt gdbm iconv ipv6 kerberos ldap ncurses nls pcre readline reflection session spell spl ssl truetype unicode xml zlib -adabas -bcmath -berkdb -birdstep -bzip2 -calendar -cdb -cgi -cjk -concurrentmodphp -ctype -curl -curlwrappers -db2 -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob -exif -fastbuild -fdftk -filter -firebird -flatfile -force-cgi-redirect -frontbase -ftp -gd -gd-external -gmp -hash -imap -inifile -interbase -iodbc (-java-external) -json -kolab -ldap-sasl -libedit -mcve -mhash -msql -mssql -mysql -mysqli -oci8 -oci8-instant-client -odbc -pcntl -pdo -pic -posix -postgres -qdbm -recode -sapdb -sharedext -sharedmem -simplexml -snmp -soap -sockets -solid -sqlite -suhosin -sybase -sybase-ct -sysvipc -threads -tidy -tokenizer -wddx -xmlreader -xmlrpc -xmlwriter -xpm -xsl -yaz -zip -zip-external" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB


You have mysql support disabled.

cwc wrote:
kashani wrote:
I would emerge -pv php and make sure that you see mysql and mysqli USE flags are turned on. Then emerge php. Emerging apache again does not affect PHP at all.

kashani


I set the flags and emerged php
No luck. I might have to config something.

part of my /etc/make.conf
APACHE2_MODULES="actions alias auth_basic mysql mysqli authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias proxy"
USE="apache2 cli crypt gdbm iconv ipv6 kerberos ldap ncurses nls pcre readline reflection session spell spl ssl truetype unicode xml zlib -adabas -bcmath -berkdb -birdstep -bzip2 -calendar -cdb -cgi -cjk -concurrentmodphp -ctype -curl -curlwrappers -db2 -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob -exif -fastbuild -fdftk -filter -firebird -flatfile -force-cgi-redirect -frontbase -ftp -gd -gd-external -gmp -hash -imap -inifile -interbase -iodbc (-java-external) -json -kolab -ldap-sasl -libedit -mcve -mhash -msql -mssql -mysql -mysqli -oci8 -oci8-instant-client -odbc -pcntl -pdo -pic -posix -postgres -qdbm -recode -sapdb -sharedext -sharedmem -simplexml -snmp -soap -sockets -solid -sqlite -suhosin -sybase -sybase-ct -sysvipc -threads -tidy -tokenizer -wddx -xmlreader -xmlrpc -xmlwriter -xpm -xsl -yaz -zip -zip-external tk"




...and that's why.

Remove the - before mysql on the USE= line in your /etc/make.conf, then emerge php again.
_________________
Game! - Where the stick is mightier than the sword!
Back to top
View user's profile Send private message
zyko
l33t
l33t


Joined: 01 Jun 2008
Posts: 620
Location: Munich, Germany

PostPosted: Thu Jun 19, 2008 12:35 am    Post subject: Reply with quote

There you go, you have "-mysql -mysqli" in your use flags.

Edit your /etc/portage/package.use to use those two flags. You need a line like this in there:

Code:
dev-lang/php mysql mysqli


Then issue emerge -avt php. Notice that your new use flags show up in red now. Then hit y to re-compile php with support for mysql.
Back to top
View user's profile Send private message
cwc
Veteran
Veteran


Joined: 20 Mar 2006
Posts: 1402
Location: Tri-Cities, WA USA

PostPosted: Thu Jun 19, 2008 1:43 am    Post subject: Reply with quote

zyko wrote:
There you go, you have "-mysql -mysqli" in your use flags.

Edit your /etc/portage/package.use to use those two flags. You need a line like this in there:

Code:
dev-lang/php mysql mysqli


Then issue emerge -avt php. Notice that your new use flags show up in red now. Then hit y to re-compile php with support for mysql.


Right on! It worked!
Thanks for the help. Using dev-lang/php mysql mysqli was the key.

*********************************************
I thought using thew following in make.conf would work. I guess I'm not sure what make.conf does along with package.use.
APACHE2_MODULES = ""
USE =""
_________________
Without diversity there can be no evolution:)
Back to top
View user's profile Send private message
cwc
Veteran
Veteran


Joined: 20 Mar 2006
Posts: 1402
Location: Tri-Cities, WA USA

PostPosted: Thu Jun 19, 2008 3:32 am    Post subject: Reply with quote

zyko wrote:
There you go, you have "-mysql -mysqli" in your use flags.

Edit your /etc/portage/package.use to use those two flags. You need a line like this in there:

Code:
dev-lang/php mysql mysqli


Then issue emerge -avt php. Notice that your new use flags show up in red now. Then hit y to re-compile php with support for mysql.


I did a man emerge and did not find "-avt".
I also wonder if setting flags in make.conf and including including :
Code:
dev-lang/php mysql mysqli in /etc/portage/package.use

Needed to booth be done.

Thanks again!
_________________
Without diversity there can be no evolution:)
Back to top
View user's profile Send private message
Mad Merlin
Veteran
Veteran


Joined: 09 May 2005
Posts: 1155

PostPosted: Thu Jun 19, 2008 4:14 am    Post subject: Reply with quote

make.conf is global (it applies to all packages), while package.use only applies to individual packages ('dev-lang/php mysql mysqli' for example adds the mysql and mysqli USE flags to dev-lang/php only). package.use takes precedence over make.conf, but you only need to set a USE flag once. package.use comes in handy when you want a specific package's USE flags to differ from the global USE flags.

emerge -avt is short for emerge -a -v -t, you should be able to find -a -v and -t in the emerge man page.
_________________
Game! - Where the stick is mightier than the sword!
Back to top
View user's profile Send private message
zyko
l33t
l33t


Joined: 01 Jun 2008
Posts: 620
Location: Munich, Germany

PostPosted: Thu Jun 19, 2008 4:36 am    Post subject: Reply with quote

I would recommend that you always use -avt when you emerge something.

-v (--verbose) makes emerge print more information.

-t (--tree) arranges items according to dependency structures. Useful to quickly spot which package depends on what.

-a (--ask) shows you what emerge would like to do and then asks if you agree (y/n). This way you can quickly examine use flags etc. before you actually do stuff.

Blindly emerging (without -a or -p) isn't a very smart thing to do. Portage offers you total control, so go ahead and use it. That's what it's all about.

There's more info here: http://gentoo-wiki.com/HOWTO_Use_Portage_Correctly and in the official documentation over at http://gentoo.org/doc/en/ .
Back to top
View user's profile Send private message
cwc
Veteran
Veteran


Joined: 20 Mar 2006
Posts: 1402
Location: Tri-Cities, WA USA

PostPosted: Thu Jun 19, 2008 1:10 pm    Post subject: Thank you all! Reply with quote

Thanks to all that helped on this one! This was a big help. In the past I've used Fedora and Redhat and all the work was done for you which made installation easy but you did not have the speed or control as with Gentoo. With all the help I've got since I started this install in late March (slow learner here) I should be able to start setting up Gentoo boxes in out off line lab at the school I teach at.

This is one of the best Linux Forum in the world!
_________________
Without diversity there can be no evolution:)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum