PDA

View Full Version : Rebuilding PHP on FC6



brian928
6th February 2007, 10:27 PM
Hello,
I've installed a website CMS on my FC6 machine. It is complaining, not very loudly,
about 2 PHP extensions not built into PHP, mbstring and the GD library. It appears
that PHP needs to be re-compiled to install those extensions. These 2 extensions are
included in the standard PHP distribution, however they may not have been activated
duing the compile.

First, am I correct in assuming the above and I need to download, compile with the
proper compile flags, and install PHP?

Second, how do I install the rebuilt php? Do I create a RPM and have yum install it?
Or just copy the executable into the proper location?

Thanks,
Brian

brunson
6th February 2007, 11:24 PM
First, am I correct in assuming the above and I need to download, compile with the proper compile flags, and install PHP?
No, that is incorrect. They are compiled as loadable modules and distributed in their own RPMs for Fedora.


yum install php-gd php-mbstring
To see a list of all php modules available try
yum list php-*

brian928
7th February 2007, 04:12 AM
Thank you very much, this is exactly what I was needing. I did not think
that I had to go through the hassle of rebuilding PHP.

Thanks again,
Brian

jvroig
7th February 2007, 05:29 AM
how about to set the --enable-memory-limit option? I want to be able to use the get_memory_usage() and get_memory_peak_usage() functions, which need PHP to be compiled with --enable-memory-limit. Do I really have to recompile PHP, or is there a quicker way to do it?

Thanks. And if I really have to recompile, can anyone help me in doing it for FC6? Thanks again :)

zivko_sudarski
7th February 2007, 09:35 AM
you don't need PHP to compiled because Fedora use rpm, not source to install PHP

test script from php.net
?php
// This is only an example, the numbers below will
// differ depending on your system

echo memory_get_usage() . "\n"; // 36640

$a = str_repeat("Hello", 4242);

echo memory_get_usage() . "\n"; // 57960

unset($a);

echo memory_get_usage() . "\n"; // 36744

?>

su -
your root pass
rpm -qa|grep php
php-bcmath-5.1.6-3.3.fc6
php-dbase-5.1.6-1.fc6
php-soap-5.1.6-3.3.fc6
php-mbstring-5.1.6-3.3.fc6
php-ldap-5.1.6-3.3.fc6
php-readline-5.1.6-1.fc6
php-xmlrpc-5.1.6-3.3.fc6
php-mysql-5.1.6-3.3.fc6
phpMyAdmin-2.9.1.1-2.fc6
php-common-5.1.6-3.3.fc6
php-imap-5.1.6-3.3.fc6
php-xml-5.1.6-3.3.fc6
php-snmp-5.1.6-3.3.fc6
php-dba-5.1.6-3.3.fc6
php-cli-5.1.6-3.3.fc6
php-gd-5.1.6-3.3.fc6
php-pdo-5.1.6-3.3.fc6
php-5.1.6-3.3.fc6
php-Smarty-2.6.13-1.fc6
php-ncurses-5.1.6-3.3.fc6

jvroig
7th February 2007, 11:25 AM
so just what rpm do i need to install for get_memory_usage() to work? anybody has any idea? I tried looking at the descriptions in yumex, but none of those seem to be the right rpm, but I"m not surprised since the memory functions are part of the php core, except that you just have to set the enable memory limit configuration... I'm completely lost here, I hope someone can straighten this out, I'm sure this is probably very simple. I always used xampp for development and recently just used yum to install php and mysql instead of DLing xampp, so I was surprised that the memory functions didn't work (get usage and get peak usage).

Thanks,
-JV

zivko_sudarski
7th February 2007, 12:30 PM
(PHP 4, PHP 5)

getrusage Gets the current resource usages
memory_get_usage

(PHP 4 >= 4.3.2, PHP 5)

memory_get_usage Returns the amount of memory allocated to PHP

su -
your root pass
yum install php-5.1.6-3.3.fc6


in fedora when install php you have it!

1. Go to ->Application->Add/Remove Software
2.enter your root pass
3. Go to Search and type PHP
4. see what rpm you have

aliber4079
22nd February 2007, 12:11 AM
No, that is incorrect. They are compiled as loadable modules and distributed in their own RPMs for Fedora.


yum install php-gd php-mbstring
To see a list of all php modules available try
yum list php-*
out of curiosity, how did you find out, did you search/post on the forum like us or do you somehow have the innate knowledge :)

brunson
22nd February 2007, 12:19 AM
Not innate knowledge :-) Simply familiarity with Fedora and the available modules. "With experience comes wisdom"

If you ever wonder about what's in the repos try "yum list something" where something can contain globbing characters like '*'. yum list php*

aliber4079
22nd February 2007, 12:29 AM
Not innate knowledge :-) Simply familiarity with Fedora and the available modules. "With experience comes wisdom"

If you ever wonder about what's in the repos try "yum list something" where something can contain globbing characters like '*'. yum list php*
thanks. Mainly I use the logic like Brian928, try to expect how something would work and make an educated guess, I just wanted to see if there is a more "efficient" thought process to finding answers. (no offense Brian ;) )

brian928
22nd February 2007, 05:45 AM
thanks. Mainly I use the logic like Brian928, try to expect how something would work and make an educated guess, I just wanted to see if there is a more "efficient" thought process to finding answers. (no offense Brian ;) )
No offense taken. In the '90s I managed a unix (sun solaris) data center. The
sys admins had to build everything at that time. Sometimes with not so great
results. It could take a long time to get perl built with all the needed options. Not
to mention the undertaking of migrating from SunOS to Solaris. RH and FC is so
much simpler now than in those days. That's why I questioned the need to rebuild
a major piece of software. The folks on this forum have been very helpful in helping
me solve a couple of my problems. Now, in a couple years I may be able to help
someone out.

Thanks,
Brian

CD-RW
22nd February 2007, 09:54 PM
Thanks. And if I really have to recompile, can anyone help me in doing it for FC6? Thanks again :)

http://forum.fedoraforum.org/forum/showthread.php?t=140305

aliber4079
23rd February 2007, 05:29 AM
speaking of, is there a way to launch php extensions like in perl, with -M? or do you have to specify the fully qualified path to the extension. eg I want to do php pear/PEAR instead of php /usr/lib/php/pear...