LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-02-2010, 03:42 AM   #1
jjena
LQ Newbie
 
Registered: Jan 2010
Posts: 10
Blog Entries: 1

Rep: Reputation: 0
Smile Compile PHP


Hi ,

I am new to linux. I am using PHP Version 5.2.9. I am facing some problem for some the extension are not enabled.I want to enable that. The extensions are

with gdbm , -with-mysql, all with --with-gd' '--enable-dom' '--enable-dba' '--with-unixODBC' '--enable-pdo' '--enable-xmlreader' '--enable-xmlwriter' '--with-sqlite' '--enable-json' '--with-pspell'


--with-gd' '--enable-dom' '--enable-dba' '--with-unixODBC' '--enable-pdo' '--enable-xmlreader' '--enable-xmlwriter' '--with-sqlite' '--enable-json' '--with-pspell'

Kindly tell me how can I compile the PHP and make the modification like the above.

Thanks & Regards,
Jyotirmay
 
Old 07-02-2010, 04:11 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,520

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
Hi,

You have to download the latest php sources (5.3.2 or 5.2.13 if you need a 5.2.x version), extract the archive, go into the directory php-5.x.x that was created and run ./configure using the options you want. E.g.
Code:
./configure --with gdbm --with-mysql --with-gd <rest of options>
You can run "./configure --help" to see the syntax of each option
Then if ./configure finishes without error you can run "make" and if this also finishes ok, su to root and run "make install"

Regards
 
Old 07-03-2010, 04:35 AM   #3
jjena
LQ Newbie
 
Registered: Jan 2010
Posts: 10
Blog Entries: 1

Original Poster
Rep: Reputation: 0
I have followed your procedure & starts with php-5.2.13.
I tried with only for --with-mysql'

./configure --with-mysql
make
make install

After that I got a message.
Installing PEAR environment: /usr/local/lib/php/
[PEAR] Archive_Tar - already installed: 1.3.3
[PEAR] Console_Getopt - already installed: 1.2.3
[PEAR] Structures_Graph- already installed: 1.0.2
[PEAR] XML_Util - already installed: 1.2.1
[PEAR] PEAR - already installed: 1.9.0
Wrote PEAR system config file at: /usr/local/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
Installing PDO headers: /usr/local/include/php/ext/pdo/


After that I restart the HHTPD service. But still it's showing --without-mysql'.


I think I doing something wrong. Kindly advice
 
Old 07-03-2010, 05:11 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,520

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
What is the output of:
Code:
php -i|grep -i mysql
If you want to use php with a web server, you need to build also the php support for the web server. For apache you'll need:
Code:
./configure --with-mysql --with-apx2=/some/path/to/apxs
Note that's always better to run "make distclean" before running ./configure again

Regards
 
Old 07-03-2010, 08:02 AM   #5
jjena
LQ Newbie
 
Registered: Jan 2010
Posts: 10
Blog Entries: 1

Original Poster
Rep: Reputation: 0
Hi,

Thanks for your reply..
The out put of php -i|grep -i mysql

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mssql.so' - libsybdb.so.5: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/oci8.so' - libclntsh.so.11.1: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo_dblib.so' - libsybdb.so.5: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo_oci.so' - libclntsh.so.11.1: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/sqlite.so' - libsqlite.so.0: cannot open shared object file: No such file or directory in Unknown on line 0
Configure Command => './configure' '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--with-t1lib=/usr' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--without-mime-magic' '--with-libxml-dir=/usr' '--enable-xml' '--with-system-tzdata' '--with-mime-magic=/usr/share/file/magic' '--enable-force-cgi-redirect' '--enable-pcntl' '--with-imap=shared' '--with-imap-ssl' '--enable-mbstring=shared' '--enable-mbregex' '--with-ncurses=shared' '--with-gd=shared' '--enable-bcmath=shared' '--enable-dba=shared' '--with-db4=/usr' '--with-xmlrpc=shared' '--with-ldap=shared' '--with-ldap-sasl' '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config' '--with-oci8=shared,instantclient,/usr/lib/oracle/11.1.0.7/client/lib,11.1.0.7' '--with-pdo-oci=shared,instantclient,/usr,11.1.0.7' '--enable-dom=shared' '--with-pgsql=shared' '--enable-wddx=shared' '--with-snmp=shared,/usr' '--enable-soap=shared' '--with-xsl=shared,/usr' '--enable-xmlreader=shared' '--enable-xmlwriter=shared' '--with-curl=shared,/usr' '--enable-fastcgi' '--enable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,/usr' '--with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr' '--with-pdo-dblib=shared,/usr' '--with-sqlite=shared,/usr' '--enable-json=shared' '--enable-zip=shared' '--with-readline' '--enable-dbase=shared' '--with-pspell=shared' '--with-mcrypt=shared,/usr' '--with-mhash=shared,/usr' '--with-tidy=shared,/usr' '--with-mssql=shared,/usr' '--enable-sysvmsg=shared' '--enable-sysvshm=shared' '--enable-sysvsem=shared' '--enable-posix=shared' '--with-unixODBC=shared,/usr' '--with-recode=shared,/usr'
/etc/php.d/mysql.ini,
/etc/php.d/mysqli.ini,
/etc/php.d/pdo_mysql.ini,
mysql
MySQL Support => enabled
MYSQL_MODULE_TYPE => external
MYSQL_SOCKET => /var/lib/mysql/mysql.sock
MYSQL_INCLUDE => -I/usr/include/mysql
MYSQL_LIBS => -L/usr/lib/mysql -lmysqlclient
mysql.allow_persistent => On => On
mysql.connect_timeout => 60 => 60
mysql.default_host => no value => no value
mysql.default_password => no value => no value
mysql.default_port => no value => no value
mysql.default_socket => no value => no value
mysql.default_user => no value => no value
mysql.max_links => Unlimited => Unlimited
mysql.max_persistent => Unlimited => Unlimited
mysql.trace_mode => Off => Off
mysqli
MysqlI Support => enabled
MYSQLI_SOCKET => /var/lib/mysql/mysql.sock
mysqli.default_host => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_pw => no value => no value
mysqli.default_socket => no value => no value
mysqli.default_user => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.reconnect => Off => Off
PDO drivers => mysql, odbc, pgsql, sqlite
pdo_mysql
PDO Driver for MySQL, client library version => 5.1.35


As I amnew to linux not getting the proper idea to compile PHP.
Kindly revert
 
Old 07-03-2010, 09:46 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,520

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
This is the output of the php that was installed previously in your box.
The one you're trying to install is in /usr/local/bin, so you have to use:
Code:
/usr/local/bin/php -i |grep -i mysql
for the same

But, from what I can see from the old php configure and the output of the command, mysql support is present in the old php.
Also it looks like your previous php does not lack the support for the things you mentioned in your 1st post (except gdbm).
What you miss is some packages, like php-mssql etc
So I don't know why you want to mess with compiling a new php.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
weird PHP compile issue- module shows in "php -m" but not in phpinfo call hbbtstar Linux - Software 1 08-28-2009 04:14 PM
PHP 5.2.0 compile konfigure Slackware 1 11-11-2006 09:12 PM
compile php with gd ? sonaatti Slackware 3 11-29-2004 11:46 AM
can't compile php 4.3.3 adrianmak Linux - Software 3 11-20-2003 09:06 PM
Compile php grubjo Linux - Software 7 09-09-2002 04:19 PM


All times are GMT -5. The time now is 03:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration