PHP as CGI and .htaccess

This is a discussion on PHP as CGI and .htaccess within the PHP Language forums, part of the PHP Programming Forums category; Hi folks, I have the Apacha server (2.2.8) with PHP installed as CGI Binary. This, as i'm ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-28-2008
Thiago Macedo
 
Posts: n/a
Default PHP as CGI and .htaccess

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
Reply With Quote
  #2 (permalink)  
Old 04-28-2008
Jerry Stuckle
 
Posts: n/a
Default Re: PHP as CGI and .htaccess

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.
jstucklex@attglobal.net
==================

Reply With Quote
  #3 (permalink)  
Old 04-28-2008
Álvaro G. Vicario
 
Posts: n/a
Default Re: PHP as CGI and .htaccess

Thiago Macedo escribió:
> 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
--
Reply With Quote
  #4 (permalink)  
Old 05-07-2008
Thiago Macedo
 
Posts: n/a
Default Re: PHP as CGI and .htaccess

On 27 abr, 23:46, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> 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.
Reply With Quote
  #5 (permalink)  
Old 05-07-2008
Jerry Stuckle
 
Posts: n/a
Default Re: PHP as CGI and .htaccess

Thiago Macedo wrote:
> On 27 abr, 23:46, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>> 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.

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

Reply With Quote
  #6 (permalink)  
Old 05-07-2008
Thiago Macedo
 
Posts: n/a
Default Re: PHP as CGI and .htaccess

On 7 maio, 11:28, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> Thiago Macedo wrote:
> > On 27 abr, 23:46, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> >> 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.
>
> --
> ==================
> 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
Reply With Quote
  #7 (permalink)  
Old 05-07-2008
Jerry Stuckle
 
Posts: n/a
Default Re: PHP as CGI and .htaccess

Thiago Macedo wrote:
> On 7 maio, 11:28, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>> Thiago Macedo wrote:
>>> On 27 abr, 23:46, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>>>> 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
==================

Reply With Quote
  #8 (permalink)  
Old 05-07-2008
Thiago Macedo
 
Posts: n/a
Default Re: PHP as CGI and .htaccess

On 7 maio, 13:56, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> Thiago Macedo wrote:
> > On 7 maio, 11:28, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> >> Thiago Macedo wrote:
> >>> On 27 abr, 23:46, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> >>>> 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
Reply With Quote
  #9 (permalink)  
Old 05-07-2008
Jerry Stuckle
 
Posts: n/a
Default Re: PHP as CGI and .htaccess

Thiago Macedo wrote:
> On 7 maio, 13:56, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>> Thiago Macedo wrote:
>>> On 7 maio, 11:28, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>>>> Thiago Macedo wrote:
>>>>> On 27 abr, 23:46, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>>>>>> 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
==================

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:53 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0