Where is the PHP source directory?

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

WeezelDS
Forum Newbie
Posts: 12
Joined: Mon Feb 28, 2005 10:22 pm

Where is the PHP source directory?

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

which php
from the command line I think will tell you where it is, if it knows.
WeezelDS
Forum Newbie
Posts: 12
Joined: Mon Feb 28, 2005 10:22 pm

Post 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 :(
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'm going to guess it means executable. :)
WeezelDS
Forum Newbie
Posts: 12
Joined: Mon Feb 28, 2005 10:22 pm

Post 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...
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

have you tried seeing what the command php-config does?
WeezelDS
Forum Newbie
Posts: 12
Joined: Mon Feb 28, 2005 10:22 pm

Post 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...
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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. :)
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post 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?
sheila
Forum Commoner
Posts: 98
Joined: Mon Sep 05, 2005 9:52 pm
Location: Texas

Post by sheila »

Try looking in /usr/src or /usr/local/src
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post 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.
(#10850)
WeezelDS
Forum Newbie
Posts: 12
Joined: Mon Feb 28, 2005 10:22 pm

Post 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 :) )
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post 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.
WeezelDS
Forum Newbie
Posts: 12
Joined: Mon Feb 28, 2005 10:22 pm

Post 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...
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you could always use a remote captcha service, like captchas.net
Post Reply