Author Topic: bizarre error  (Read 4456 times)

vladimir_ivanov2

  • Beginner
  • *
  • Posts: 4
bizarre error
« on: October 24, 2008, 16:20:07 pm »
hi, I just have installed the virtuemart latest version 1.1.2 on Joomla 1.0.15.
Everything was just fine until I tried to access the product description page.


I receive this message:

Security Alert! The PHP CGI cannot be accessed directly.

This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.

For more information as to why this behaviour exists, see the manual page for CGI security.

For more information about changing this behaviour or re-enabling this webserver, consult the installation file that came with this distribution, or visit the manual page.


I compare my product description page URL with some on the Virtuemart demo page and my URL was like this:

/php4-cgi?page=shop.product_details&flypage=flypage-ask.tpl&product_id=17&category_id=2&option=com_virtuemart&Itemid=133

and on the virtuemart demo site was like this:

index.php?page=shop.product_details&flypage=flypage.tpl&product_id=36&category_id=2&option=com_virtuemart&Itemid=53

please take a look at the first part of my URL: ...php4-cgi?...

anyone?

vladimir

vladimir_ivanov2

  • Beginner
  • *
  • Posts: 4
Re: bizarre error
« Reply #1 on: October 24, 2008, 17:21:39 pm »
i discover that if i replace the php4-cgi? with index.php? in the address bar everything is working fine.

from where these php4-cgi? is coming?

vladimir

[attachment cleanup by admin]

fw116

  • Jr. Member
  • **
  • Posts: 66
Re: bizarre error
« Reply #2 on: October 30, 2008, 20:37:22 pm »
php4 is obsolete..

if your hoster can't offer you a php5 hosting environment, change your hoster ASAP!

Erik P

  • Jr. Member
  • **
  • Posts: 114
Re: bizarre error
« Reply #3 on: October 30, 2008, 21:37:42 pm »
The problem occurs in the file administrator/components/com_virtuemart/classes/ps_session.php in the method:

function url(...){...}

Normally, the expression basename( $_SERVER['SCRIPT_NAME'] ) will return something like: index.php.

In my impression, when php4 is running in cgi mode (don't know about php5), the variable  $_SERVER['SCRIPT_NAME'] could contain something like /pub-cgi/php-4.3.10-4 or something like /cgi-bin/php-4.3.10-4.

I don't know in what circumstances exactly this will predictibly occurs, but it obviously occurs in your installation.

The quick hack to solve the problem, consists in:
  • rename your ps_session.php to ps_session.php.original
  • do a find for SCRIPT_NAME and in ps_session.php, and replace all the expression basename( $_SERVER['SCRIPT_NAME'] ) by the string expression 'index.php'.


This is an insidiously ugly hack, but nine out of ten, it will solve the problem for you.

If the insidious hack did not solve the problem, delete the modified ps_session.php and rename ps_session.php.original back to ps_session.php.

The problem of wrong scriptname, will only show up in the following files:

$ grep -rc SCRIPT_NAME * | grep -v :0

classes/nusoap/class.soap_server.php:6
classes/nusoap/nusoap.php:6
classes/ps_session.php:4

So, your soap server won't work properly either. If that bothers you somehow, you would have to apply the same insidious hack to the other files too.

By the way, this does not mean that all potential problems in using php4 as opposed to php5, and then in cgi mode, will all be solved ...
http://sankuru.biz. Software services. Customizing and fixing Virtuemart installations.

fw116

  • Jr. Member
  • **
  • Posts: 66
Re: bizarre error
« Reply #4 on: October 30, 2008, 21:52:02 pm »
ok, then in other words:


PHP 4 is EOL = END OF LIFE. thus, no security updates,no support anymore...

you have to chnage to php5 !

so do it !


vladimir_ivanov2

  • Beginner
  • *
  • Posts: 4
Re: bizarre error - solved
« Reply #5 on: November 03, 2008, 14:20:04 pm »
hi, the problem was solved updating the PHP to version 5.

bye
vladimir

Christopher

  • Jr. Member
  • **
  • Posts: 93
    • CDTi
Re: bizarre error
« Reply #6 on: January 21, 2009, 16:15:35 pm »
php4 is obsolete..
if your hoster can't offer you a php5 hosting environment, change your hoster ASAP!

I've got a bunch of 1.0.15 sites hosted on a server running PHP v4.4.2 and have just come across this error with doing my first install of vm1.1.2

If I upgrade to PHP v5.x.x, are my older vm sites going to continue working or am I looking at opening a real can of worms with my customers?

Any advice would be great
There are 10 types of people in the world:
Those who understand binary and those who don't