Gossamer Forum
Home : General : Internet Technologies :

PHP Install

Quote Reply
PHP Install
I'm trying to install php as a DSO on linux...pretty simple normally but as always there's a problem.

./configure --with-mysql --with-apxs

...apxs isn't found so I enter the full path:

./configure --with-mysql --with-apxs=/path/to/apxs

...and it just blurbs out the apxs help page and configure exits.

Any ideas why it's doing that?....its like apxs isn't recognising the whatever configure is telling it.

Last edited by:

Paul: May 6, 2002, 10:45 AM
Quote Reply
Re: [Paul] PHP Install In reply to
Hi Paul,

I'm hoping to do the same this weekend on my Linux box. Have you tried adding the path to mysql like this?

./configure --with-apxs=/path/to/apxs \
--with-mysql=/path/to/mysql

~ ERASER


Free JavaScripts @ Insight Eye
Quote Reply
Re: [Eraser] PHP Install In reply to
I think the error is to do with apxs rather than mysql.

I ended up having to create the php binary by chopping off --with-apxs

Im still working out how to set it up in httpd.conf ....I've added:

AddType application/x-httpd-php .php
Action application/x-httpd-php "/usr/local/bin/php"

....but when I try to execute a php script I just get:

Cannot find /usr/local/bin/php/phpinfo.php on this server.

Ugh.

Im losing the will to live this week.

Last edited by:

Paul: May 7, 2002, 1:36 PM
Quote Reply
Re: [Paul] PHP Install In reply to
Yes I know, but when in doubt I always try with all the paths ;-)

Hmm.. not sure about the "Action application/x-httpd-php "/usr/local/bin/php"

I'm sure this is only needed for PHP under a windows server.

Just a: AddType application/x-httpd-php .php should do it.

~ ERASER


Free JavaScripts @ Insight Eye

Last edited by:

Eraser: May 7, 2002, 2:12 PM
Quote Reply
Re: [Eraser] PHP Install In reply to
>>
Just a: AddType application/x-httpd-php .php should do it.
<<

yeah but surely apache has to know to pass php scripts through the binary seeing as it's not a DSO?

I've tried adding:

#!/usr/local/bin/php into the php script but that didn't work either.

Last edited by:

Paul: May 7, 2002, 2:22 PM
Quote Reply
Re: [Paul] PHP Install In reply to
How are you actually building PHP? You cant build as a standalone binary unless on windows, or using for non web scripting PHP as a CGI - its either as a shared object (DSO) or into the httpd binary itself.

~ ERASER


Free JavaScripts @ Insight Eye

Last edited by:

Eraser: May 7, 2002, 2:57 PM
Quote Reply
Re: [Eraser] PHP Install In reply to
>>You cant build as a standalone binary unless on windows<<

Sure you can. I have done so and I have it working from the command line but just need apache to recognise it.

shell> /usr/local/bin/php /path/to/phpinfo.php

...prints out the output from <? phpinfo(); ?>

By removing --with-apxs it builds a binary file rather than an apache DSO.
Quote Reply
Re: [Paul] PHP Install In reply to
Quote:
Action application/x-httpd-php "/usr/local/bin/php"


See: http://httpd.apache.org/..._actions.html#action

You need a URL, not a file path.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] PHP Install In reply to
So Windows version of apache must be different then as the Action handler uses a path?
Quote Reply
Re: [Alex] PHP Install In reply to
Ok I solved this eventually...I used:

ScriptAlias /php/ "/path/to/web/"

AddType application/x-httpd-php .php

Action application/x-httpd-php /php/php

I had to recompile php with --disable-force-cgi-redirect too.

Edit: Ive gotten rid of the action line and put #!/usr/local/bin/php inside the php scripts - I think thats safer.

Last edited by:

Paul: May 10, 2002, 4:14 AM