Page 1 of 2

Where is the PHP source directory?

Posted: Thu Jan 26, 2006 5:58 pm
by WeezelDS
I didn't install php myself on my webserver....its running redhat...i need to re configure php with the additional flag of --with-gd for automatic image generation....i tried to run the configure command that my phpinfo tells me plus the extra flag, but it always says './configure no such file or directory'....i figured the ./configure command should be run from the php source directory, and i looked all over the place on my server to find it but no luck....i'm running php 4.3.11....

also if i can ever get the configure command to run, do i need to do a make, make install?....or will restarting apache do the trick?

such a seemingly simple thing...so frustrating

thanks in advance

Posted: Thu Jan 26, 2006 6:04 pm
by feyd

Code: Select all

which php
from the command line I think will tell you where it is, if it knows.

Posted: Thu Jan 26, 2006 6:21 pm
by WeezelDS
thanks for the reply

Code: Select all

which php
says:

/usr/local/bin/php



but doing a dir in /usr/local/bin/ shows:

./ ../ pear* perl@ php* php-config* phpextdist* phpize*



i dont even know wut that asterisk means, but its not a directory i can get into :(

Posted: Thu Jan 26, 2006 6:23 pm
by feyd
I'm going to guess it means executable. :)

Posted: Thu Jan 26, 2006 6:33 pm
by WeezelDS
alrite, well, my ./configure command still won't work cuz it says ./configure: No such file or directory

this shouldn't be so difficult....am I missing something?...

here is the configure command i'm trying to use

Code: Select all

'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--enable-ftp' '--enable-magic-quotes' '--with-mysql=/usr' '--with-openssl' '--enable-discard-path' '--with-pear' '--enable-sockets' '--enable-track-vars' '--enable-versioning' '--with-zlib' '--with-gd'
i tried it w/ and w/o the single quotes, but obviously i dont think that is the problem


thanks again, i'm just getting frustrated...and my boss is acting like a d*ck...

Posted: Thu Jan 26, 2006 6:45 pm
by feyd
have you tried seeing what the command php-config does?

Posted: Thu Jan 26, 2006 7:11 pm
by WeezelDS
from the man pages for it, (which it didnt come w/) it says it only gives you info about your php configuration...which phpinfo seems to do a much better job of doing...

i don't see how php-config can help me here...am I wrong?




I could've swore i changed the configuration before and it wasn't this gutwrenching...

Posted: Thu Jan 26, 2006 9:10 pm
by feyd
Sorry, I'm outta my league now. Don't work on *nix much, nor have I ever had to build PHP on it. :D

I bet someone here has though. :)

Posted: Thu Jan 26, 2006 9:24 pm
by josh
First of all you might want to try just installing the dynamic GD extension, I know on fedora yum can even install it all for you.

Have you actually downloaded the source, untar'd it, cd'd to the source directory and then tried running ./configure? This seems like a stupid question but it should not be telling you ./configure cannot be found if you're running it in the source directory. If you are can you do a ls -la and verify configure is there?

Posted: Thu Jan 26, 2006 9:39 pm
by sheila
Try looking in /usr/src or /usr/local/src

Posted: Thu Jan 26, 2006 10:48 pm
by Christopher
You probably need to recompile PHP, but you may be able to find a RPM of PHP with the extensions that you want.

If you need to recompule, just download PHP into someplace like /usr/local/src and run the config line ou posted.

Posted: Fri Jan 27, 2006 1:29 pm
by WeezelDS
Thanks for the replies :)

as far as installing gd seperately....php.net recommends using the prepackaged GD library that comes w/ php....also, from wut i understand, I'd need to do a ./configure that way also but w/ '--with-gd[=DIR]' where dir is the gd installation directory rather than just '--with-gd' tacked on

I did an ls -al in /usr/src/, /usr/local/src/, and /usr/local/bin/....none of them showed ./configure to be there....I can't find it anywhere

In regards to totally re-installing php....I didn't install php to begin w/ on this box....and frankly it scares me a little cuz my site gets a lot of traffic, any down time would be very costly....

according to php.net, GD should be standard in all versions 4.3.0 and up

I dont suppose somebody could post their configure file and that would work? (here's where i invite a hacker into my bedroom, so to speak :) )

Posted: Fri Jan 27, 2006 1:45 pm
by redmonkey
'configure' is a script which is specific to each applications source distribution. You will not have a configure script unless you have the PHP sources.

I suspect that PHP has been installed from a (pre-built) binary package, if that's the case it's not quite as simple as just downloading the sources and running configure with '--with-gd' tacked on the end as it's most likely that many of required additional libraries will not be available on your system either.

You will need several additional libraries if you want to build PHP with a reasonable feature set. I would sugest that you search for a pre-built binary package which has GD (and all other features/extensions you require) enabled and install that.

It's also not recommended to use an external GD source i.e. '--with-gd=DIR' unless you have a good reason for doing so.

Posted: Fri Jan 27, 2006 1:55 pm
by WeezelDS
Ugg, thats bad news....if I'm gonna do that I might as well migrate to php5, which i've kinda wanted to do anyways, but I'm afraid of messing something up in the process....

I didnt think putting a captcha (aka visual confirmation) module into my site would be so excrutiating...



anyways, thanks for the help guys...looks like I'm gonna look at migrating to php5 if I wanna go ahead w/ this...

Posted: Fri Jan 27, 2006 2:02 pm
by feyd
you could always use a remote captcha service, like captchas.net