View previous topic :: View next topic |
Author |
Message |
cwc Veteran
Joined: 20 Mar 2006 Posts: 1402 Location: Tri-Cities, WA USA
|
Posted: Wed Jun 18, 2008 3:22 pm Post subject: How do I add mysql to php? [SOLVED] |
|
|
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 |
|
|
makism Tux's lil' helper
Joined: 24 Oct 2007 Posts: 85
|
Posted: Wed Jun 18, 2008 3:34 pm Post subject: |
|
|
as ./configure indicates, you have no support for mysql in php...
try, emerging php again, with USE="mysql mysqli" |
|
Back to top |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1402 Location: Tri-Cities, WA USA
|
Posted: Wed Jun 18, 2008 6:54 pm Post subject: I added mysql and mysqli |
|
|
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 |
|
|
tgR10 Apprentice
Joined: 23 Oct 2007 Posts: 262 Location: caly ten ambaras
|
Posted: Wed Jun 18, 2008 8:08 pm Post subject: |
|
|
Code: | equery u php|grep mysql |
if it show somethink like
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 |
|
|
xtz Apprentice
Joined: 29 Oct 2007 Posts: 181 Location: Singapore
|
Posted: Wed Jun 18, 2008 8:10 pm Post subject: |
|
|
mysql.dll |
|
Back to top |
|
|
kashani Advocate
Joined: 02 Sep 2002 Posts: 2032 Location: San Francisco
|
Posted: Wed Jun 18, 2008 8:34 pm Post subject: |
|
|
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 |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1402 Location: Tri-Cities, WA USA
|
Posted: Wed Jun 18, 2008 9:33 pm Post subject: |
|
|
/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 |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1402 Location: Tri-Cities, WA USA
|
Posted: Wed Jun 18, 2008 10:28 pm Post subject: no luck |
|
|
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 |
|
|
kashani Advocate
Joined: 02 Sep 2002 Posts: 2032 Location: San Francisco
|
Posted: Wed Jun 18, 2008 10:30 pm Post subject: |
|
|
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 |
|
|
zyko l33t
Joined: 01 Jun 2008 Posts: 620 Location: Munich, Germany
|
Posted: Wed Jun 18, 2008 10:45 pm Post subject: |
|
|
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 |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1402 Location: Tri-Cities, WA USA
|
Posted: Wed Jun 18, 2008 11:38 pm Post subject: |
|
|
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 |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1402 Location: Tri-Cities, WA USA
|
Posted: Wed Jun 18, 2008 11:41 pm Post subject: setting use and apache? |
|
|
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 |
|
|
Mad Merlin Veteran
Joined: 09 May 2005 Posts: 1155
|
Posted: Thu Jun 19, 2008 12:34 am Post subject: |
|
|
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 |
|
|
zyko l33t
Joined: 01 Jun 2008 Posts: 620 Location: Munich, Germany
|
Posted: Thu Jun 19, 2008 12:35 am Post subject: |
|
|
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 |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1402 Location: Tri-Cities, WA USA
|
Posted: Thu Jun 19, 2008 1:43 am Post subject: |
|
|
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 |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1402 Location: Tri-Cities, WA USA
|
Posted: Thu Jun 19, 2008 3:32 am Post subject: |
|
|
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 |
|
|
Mad Merlin Veteran
Joined: 09 May 2005 Posts: 1155
|
Posted: Thu Jun 19, 2008 4:14 am Post subject: |
|
|
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 |
|
|
zyko l33t
Joined: 01 Jun 2008 Posts: 620 Location: Munich, Germany
|
Posted: Thu Jun 19, 2008 4:36 am Post subject: |
|
|
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 |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1402 Location: Tri-Cities, WA USA
|
Posted: Thu Jun 19, 2008 1:10 pm Post subject: Thank you all! |
|
|
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 |
|
|
|