You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "J. Bakshi (জ বকসী)" <jo...@infoservices.in> on 2011/12/16 10:55:08 UTC

[users@httpd] php 5.2 as cgi automatically changes protocol !!!

Dear list,

I ma facing a strange problem in my debian squeeze box having apache and both php 5.3 as module
 + php 5.2 as cgi.

Whenever I set any site to work with 5.2 cgi, the http:// protocol automatically changes to https://
and the link becomes as

````````````
https://192.168.1.1/php5-cgi/<site-name>/index.php
```````````````

Just notice:

1] protocol automatically changes to https://
2] an inclusion of /php5-cgi/ after the IP

IF I remove the /php5-cgi/ and keep the protocol as it is (https://) site appers, but as soon as I click on any link
the problem reappears !!!


The apache related config is


/etc/apache2/php52.conf

 ``````````````````
ScriptAlias /php5-cgi  /usr/lib/cgi-bin/php52/php52.fcgi
Action application/x-httpd-php5  /php5-cgi
AddHandler application/x-httpd-php5 .php .php5 .php4 .php3 .phtml
 ````````````````````

The wrapper script is

/usr/lib/cgi-bin/php52/php52.fcgi

`````````
#!/bin/sh
export PHPFCGICHILDREN=4
export PHPFCGIMAX_REQUESTS=200
export PHPRC="/usr/local/bin/php5.2/etc/php.ini"
exec /usr/local/bin/php5.2/bin/php-cgi
```````````

and the site which needs php 5.2 have the following at .htaccess

``````````
<FilesMatch "\.php">
SetHandler application/x-httpd-php5
</FilesMatch>
`````````

The info.php reports it has php 5.2, but the strange protocol issue and inclusion of /php5-cgi/
create problems.

any clue is very much appreciated.

Thanks

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] php 5.2 as cgi automatically changes protocol !!!

Posted by Igor Galić <i....@brainsware.org>.
> > > 
> > > The info.php reports it has php 5.2, but the strange protocol
> > > issue
> > > and inclusion of /php5-cgi/
> > > create problems.
> > 
> > Maybe the application does it?
> > 
> 
> No no.. with php 5.3 as module it works without this very issue ....

Btw, you are aware that PHP 5.2 has been deprecated?

  http://www.php.net/archive/2011.php#id2011-08-23-1

i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] php 5.2 as cgi automatically changes protocol !!!

Posted by "J. Bakshi (জ বকসী)" <jo...@infoservices.in>.
On Fri, 16 Dec 2011 10:51:15 -0000 (UTC)
Igor Galić <i....@brainsware.org> wrote:

> 
> 
> ----- Original Message -----
> > Dear list,
> > 
> > I ma facing a strange problem in my debian squeeze box having apache
> > and both php 5.3 as module
> >  + php 5.2 as cgi.
> > 
> > Whenever I set any site to work with 5.2 cgi, the http:// protocol
> > automatically changes to https://
> > and the link becomes as
> > 
> > ````````````
> > https://192.168.1.1/php5-cgi/<site-name>/index.php
> > ```````````````
> > 
> > Just notice:
> > 
> > 1] protocol automatically changes to https://
> > 2] an inclusion of /php5-cgi/ after the IP
> > 
> > IF I remove the /php5-cgi/ and keep the protocol as it is (https://)
> > site appers, but as soon as I click on any link
> > the problem reappears !!!
> > 
> > 
> > The apache related config is
> > 
> > 
> > /etc/apache2/php52.conf
> > 
> >  ``````````````````
> > ScriptAlias /php5-cgi  /usr/lib/cgi-bin/php52/php52.fcgi
> > Action application/x-httpd-php5  /php5-cgi
> > AddHandler application/x-httpd-php5 .php .php5 .php4 .php3 .phtml
> >  ````````````````````
> > 
> > The wrapper script is
> > 
> > /usr/lib/cgi-bin/php52/php52.fcgi
> > 
> > `````````
> > #!/bin/sh
> > export PHPFCGICHILDREN=4
> > export PHPFCGIMAX_REQUESTS=200
> > export PHPRC="/usr/local/bin/php5.2/etc/php.ini"
> > exec /usr/local/bin/php5.2/bin/php-cgi
> > ```````````
> > 
> > and the site which needs php 5.2 have the following at .htaccess
> > 
> > ``````````
> > <FilesMatch "\.php">
> > SetHandler application/x-httpd-php5
> > </FilesMatch>
> > `````````
> > 
> > The info.php reports it has php 5.2, but the strange protocol issue
> > and inclusion of /php5-cgi/
> > create problems.
> 
> Maybe the application does it?
> 

No no.. with php 5.3 as module it works without this very issue ....

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] php 5.2 as cgi automatically changes protocol !!!

Posted by Igor Galić <i....@brainsware.org>.

----- Original Message -----
> Dear list,
> 
> I ma facing a strange problem in my debian squeeze box having apache
> and both php 5.3 as module
>  + php 5.2 as cgi.
> 
> Whenever I set any site to work with 5.2 cgi, the http:// protocol
> automatically changes to https://
> and the link becomes as
> 
> ````````````
> https://192.168.1.1/php5-cgi/<site-name>/index.php
> ```````````````
> 
> Just notice:
> 
> 1] protocol automatically changes to https://
> 2] an inclusion of /php5-cgi/ after the IP
> 
> IF I remove the /php5-cgi/ and keep the protocol as it is (https://)
> site appers, but as soon as I click on any link
> the problem reappears !!!
> 
> 
> The apache related config is
> 
> 
> /etc/apache2/php52.conf
> 
>  ``````````````````
> ScriptAlias /php5-cgi  /usr/lib/cgi-bin/php52/php52.fcgi
> Action application/x-httpd-php5  /php5-cgi
> AddHandler application/x-httpd-php5 .php .php5 .php4 .php3 .phtml
>  ````````````````````
> 
> The wrapper script is
> 
> /usr/lib/cgi-bin/php52/php52.fcgi
> 
> `````````
> #!/bin/sh
> export PHPFCGICHILDREN=4
> export PHPFCGIMAX_REQUESTS=200
> export PHPRC="/usr/local/bin/php5.2/etc/php.ini"
> exec /usr/local/bin/php5.2/bin/php-cgi
> ```````````
> 
> and the site which needs php 5.2 have the following at .htaccess
> 
> ``````````
> <FilesMatch "\.php">
> SetHandler application/x-httpd-php5
> </FilesMatch>
> `````````
> 
> The info.php reports it has php 5.2, but the strange protocol issue
> and inclusion of /php5-cgi/
> create problems.

Maybe the application does it?

Lookout for header('Location'...); in the code.

> any clue is very much appreciated.
> 
> Thanks

i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org