Connecting Tech Pros Worldwide Help | Site Map

PHP as CGI and .htaccess

Thiago Macedo
Guest
 
Posts: n/a
#1: Jun 2 '08
Hi folks,

I have the Apacha server (2.2.8) with PHP installed as CGI Binary.
This, as i'm discovering, means that I can't change php configurations
through .htaccess.
Is my searches right or there is a way of change a PHP - CGI Bynary -
setting using .htaccess?

Thanks,

Thiago
=?ISO-8859-1?Q?=22=C1lvaro_G=2E_Vicario=22?=
Guest
 
Posts: n/a
#2: Jun 2 '08

re: PHP as CGI and .htaccess


Thiago Macedo escribió:
Quote:
I have the Apacha server (2.2.8) with PHP installed as CGI Binary.
This, as i'm discovering, means that I can't change php configurations
through .htaccess.
Is my searches right or there is a way of change a PHP - CGI Bynary -
setting using .htaccess?
As far as I know, there isn't. You need to change them in your per-user
php.ini file or from PHP itself, if such settings would allow ini_set().

I normally make my scripts check whether they have the correct settings
and refuse to run if they don't. That way I immediately notice that
..htaccess is not working and I can make the appropriate changes in my
custom php.ini file.



--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al baño María: http://www.demogracia.com
--
Jerry Stuckle
Guest
 
Posts: n/a
#3: Jun 2 '08

re: PHP as CGI and .htaccess


Thiago Macedo wrote:
Quote:
Hi folks,
>
I have the Apacha server (2.2.8) with PHP installed as CGI Binary.
This, as i'm discovering, means that I can't change php configurations
through .htaccess.
Is my searches right or there is a way of change a PHP - CGI Bynary -
setting using .htaccess?
>
Thanks,
>
Thiago
>
True. Why not install PHP as an Apache module?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Thiago Macedo
Guest
 
Posts: n/a
#4: Jun 2 '08

re: PHP as CGI and .htaccess


On 27 abr, 23:46, Jerry Stuckle <jstuck...@attglobal.netwrote:
Quote:
Thiago Macedo wrote:
Quote:
Hi folks,
>
Quote:
I have the Apacha server (2.2.8) with PHP installed as CGI Binary.
This, as i'm discovering, means that I can't change php configurations
through .htaccess.
Is my searches right or there is a way of change a PHP - CGI Bynary -
setting using .htaccess?
>
Quote:
Thanks,
>
Quote:
Thiago
>
True. Why not install PHP as an Apache module?
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
I can't do it. I followed the install instructions but it doesn't work
for PHP 4. PHP 5 everything goes OK.
Jerry Stuckle
Guest
 
Posts: n/a
#5: Jun 2 '08

re: PHP as CGI and .htaccess


Thiago Macedo wrote:
Quote:
On 27 abr, 23:46, Jerry Stuckle <jstuck...@attglobal.netwrote:
Quote:
>Thiago Macedo wrote:
Quote:
>>Hi folks,
>>I have the Apacha server (2.2.8) with PHP installed as CGI Binary.
>>This, as i'm discovering, means that I can't change php configurations
>>through .htaccess.
>>Is my searches right or there is a way of change a PHP - CGI Bynary -
>>setting using .htaccess?
>>Thanks,
>>Thiago
>True. Why not install PHP as an Apache module?
>>
>--
>==================
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>jstuck...@attglobal.net
>==================
>
I can't do it. I followed the install instructions but it doesn't work
for PHP 4. PHP 5 everything goes OK.
>
I've installed both PHP 4 and 5 as Apache modules, and it works fine.
You just can't have both installed on the same system.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Thiago Macedo
Guest
 
Posts: n/a
#6: Jun 2 '08

re: PHP as CGI and .htaccess


On 7 maio, 11:28, Jerry Stuckle <jstuck...@attglobal.netwrote:
Quote:
Thiago Macedo wrote:
Quote:
On 27 abr, 23:46, Jerry Stuckle <jstuck...@attglobal.netwrote:
Quote:
Thiago Macedo wrote:
>Hi folks,
>I have the Apacha server (2.2.8) with PHP installed as CGI Binary.
>This, as i'm discovering, means that I can't change php configurations
>through .htaccess.
>Is my searches right or there is a way of change a PHP - CGI Bynary -
>setting using .htaccess?
>Thanks,
>Thiago
True. Why not install PHP as an Apache module?
>
Quote:
Quote:
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
>
Quote:
I can't do it. I followed the install instructions but it doesn't work
for PHP 4. PHP 5 everything goes OK.
>
I've installed both PHP 4 and 5 as Apache modules, and it works fine.
You just can't have both installed on the same system.
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
"Module not found" error. Specified the PATH and php ini_dir, while
the other httpd directives.
Other anoying problem is that as CGI binary (PHP 4) i cant install
extensions
:p

thanks for reply.

Thiago
Jerry Stuckle
Guest
 
Posts: n/a
#7: Jun 2 '08

re: PHP as CGI and .htaccess


Thiago Macedo wrote:
Quote:
On 7 maio, 11:28, Jerry Stuckle <jstuck...@attglobal.netwrote:
Quote:
>Thiago Macedo wrote:
Quote:
>>On 27 abr, 23:46, Jerry Stuckle <jstuck...@attglobal.netwrote:
>>>Thiago Macedo wrote:
>>>>Hi folks,
>>>>I have the Apacha server (2.2.8) with PHP installed as CGI Binary.
>>>>This, as i'm discovering, means that I can't change php configurations
>>>>through .htaccess.
>>>>Is my searches right or there is a way of change a PHP - CGI Bynary -
>>>>setting using .htaccess?
>>>>Thanks,
>>>>Thiago
>>>True. Why not install PHP as an Apache module?
>>>--
>>>==================
>>>Remove the "x" from my email address
>>>Jerry Stuckle
>>>JDS Computer Training Corp.
>>>jstuck...@attglobal.net
>>>==================
>>I can't do it. I followed the install instructions but it doesn't work
>>for PHP 4. PHP 5 everything goes OK.
>I've installed both PHP 4 and 5 as Apache modules, and it works fine.
>You just can't have both installed on the same system.
>>
>
"Module not found" error. Specified the PATH and php ini_dir, while
the other httpd directives.
Other anoying problem is that as CGI binary (PHP 4) i cant install
extensions
:p
>
thanks for reply.
>
Thiago
>
Then you have done something wrong. It works fine, when you specify
things correctly.

But not knowing what you did, it's impossible to say. It could be
anything from an incorrect statement to security issues (the Apache user
not having permission to execute the module) to an associated module
missing.

But it does work - quite well, in fact.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Jerry Stuckle
Guest
 
Posts: n/a
#8: Jun 2 '08

re: PHP as CGI and .htaccess


Thiago Macedo wrote:
Quote:
On 7 maio, 13:56, Jerry Stuckle <jstuck...@attglobal.netwrote:
Quote:
>Thiago Macedo wrote:
Quote:
>>On 7 maio, 11:28, Jerry Stuckle <jstuck...@attglobal.netwrote:
>>>Thiago Macedo wrote:
>>>>On 27 abr, 23:46, Jerry Stuckle <jstuck...@attglobal.netwrote:
>>>>>Thiago Macedo wrote:
>>>>>>Hi folks,
>>>>>>I have the Apacha server (2.2.8) with PHP installed as CGI Binary.
>>>>>>This, as i'm discovering, means that I can't change php configurations
>>>>>>through .htaccess.
>>>>>>Is my searches right or there is a way of change a PHP - CGI Bynary -
>>>>>>setting using .htaccess?
>>>>>>Thanks,
>>>>>>Thiago
>>>>>True. Why not install PHP as an Apache module?
>>>>>--
>>>>>==================
>>>>>Remove the "x" from my email address
>>>>>Jerry Stuckle
>>>>>JDS Computer Training Corp.
>>>>>jstuck...@attglobal.net
>>>>>==================
>>>>I can't do it. I followed the install instructions but it doesn't work
>>>>for PHP 4. PHP 5 everything goes OK.
>>>I've installed both PHP 4 and 5 as Apache modules, and it works fine.
>>>You just can't have both installed on the same system.
>>"Module not found" error. Specified the PATH and php ini_dir, while
>>the other httpd directives.
>>Other anoying problem is that as CGI binary (PHP 4) i cant install
>>extensions
>>:p
>>thanks for reply.
>>Thiago
>Then you have done something wrong. It works fine, when you specify
>things correctly.
>>
>But not knowing what you did, it's impossible to say. It could be
>anything from an incorrect statement to security issues (the Apache user
>not having permission to execute the module) to an associated module
>missing.
>>
>But it does work - quite well, in fact.
>>
>--
>==================
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>jstuck...@attglobal.net
>==================
>
yes, for sure it works and i'm missing something.
Can you tell me about this security issues? what is the user apache
works on?
the associated modules are in the ./dlls path and must be copied to
the php root directory, right?
other consideration.. in PHP 5 package we have a module for Apache 2.2
and one for 2.0. I'm trying to install them in Apache 2.2. PHP 4 works
on it, while it have just an module for Apache 2?
>
Thanks again,
>
Thiago
>
Your sysadmin should be able to help you out with the security issues.

But I may have to backtrack on that PHP 4 issue. I never tried
installing it on Apache 2.2 (just read back and put 2 and 2 together).
I had gone to PHP 5 long before that. So it may not work for you. You
may have to install it as a cgi, in which case your .htaccess won't work.

Personally, I don't know why you'd use an unsupported version of PHP
anyway, but I'm sure you have your reasons.

But if you want to use it, you'll probably have to download the source
files and compile it yourself. It's not that hard under Unix, but some
of the Apache API's have changed and I don't know if it can even be
compiled against Apache 2.2 libs.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Thiago Macedo
Guest
 
Posts: n/a
#9: Jun 2 '08

re: PHP as CGI and .htaccess


On 7 maio, 13:56, Jerry Stuckle <jstuck...@attglobal.netwrote:
Quote:
Thiago Macedo wrote:
Quote:
On 7 maio, 11:28, Jerry Stuckle <jstuck...@attglobal.netwrote:
Quote:
Thiago Macedo wrote:
>On 27 abr, 23:46, Jerry Stuckle <jstuck...@attglobal.netwrote:
>>Thiago Macedo wrote:
>>>Hi folks,
>>>I have the Apacha server (2.2.8) with PHP installed as CGI Binary.
>>>This, as i'm discovering, means that I can't change php configurations
>>>through .htaccess.
>>>Is my searches right or there is a way of change a PHP - CGI Bynary -
>>>setting using .htaccess?
>>>Thanks,
>>>Thiago
>>True. Why not install PHP as an Apache module?
>>--
>>==================
>>Remove the "x" from my email address
>>Jerry Stuckle
>>JDS Computer Training Corp.
>>jstuck...@attglobal.net
>>==================
>I can't do it. I followed the install instructions but it doesn't work
>for PHP 4. PHP 5 everything goes OK.
I've installed both PHP 4 and 5 as Apache modules, and it works fine.
You just can't have both installed on the same system.
>
Quote:
"Module not found" error. Specified the PATH and php ini_dir, while
the other httpd directives.
Other anoying problem is that as CGI binary (PHP 4) i cant install
extensions
:p
>
Quote:
thanks for reply.
>
Quote:
Thiago
>
Then you have done something wrong. It works fine, when you specify
things correctly.
>
But not knowing what you did, it's impossible to say. It could be
anything from an incorrect statement to security issues (the Apache user
not having permission to execute the module) to an associated module
missing.
>
But it does work - quite well, in fact.
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
yes, for sure it works and i'm missing something.
Can you tell me about this security issues? what is the user apache
works on?
the associated modules are in the ./dlls path and must be copied to
the php root directory, right?
other consideration.. in PHP 5 package we have a module for Apache 2.2
and one for 2.0. I'm trying to install them in Apache 2.2. PHP 4 works
on it, while it have just an module for Apache 2?

Thanks again,

Thiago
Closed Thread