Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PHP installed as CGI help...


fdenger

Recommended Posts

Hello,

 

I have osCommerce running fine on my test server which I control, and it is working out quite nicely...

 

My problem is that my production server doesn't support PHP module for the webserver. I contacted my system administrator and he replied:

 

"PHP is set up as a cgi, so at the top of every PHP file you will have to include

 

#!/usr/local/bin/php

 

 

osCommerce doesn't have this in their .php files. Does osCommerce support such a configuration or should I save the trouble and just find someone else to host the site?

 

 

I don't really understand how this will affect osCommerce if i were to replace this on every file. I doubt the system would run proeprly. I looked in the .ini file and it mentions cgi mode webservers, but I can't find in the documentation anywhere where it talks about installing oscommerce on a CGI PHP server..

 

any help would be GREATLY appreciated!

 

thanks!

Link to comment
Share on other sites

I have not tried this but I would try putting

 

#!/usr/local/bin/php

 

In application_top.php or header.php. I think every file includes these.

The problem is that the line tells it to run as PHP. application_top.php is included *BY* the PHP program, which won't be running. If the host is correct (I've never run PHP as CGI, so I don't know anything about that part of it), then you would have to put the line at the top of every file in the base catalog and admin directories. You should not have to include it in any of the subdirectories (includes, etc.).

 

osCommerce does not include the line for several reasons:

 

1. Most people do not install PHP as CGI. Instead, they install it such that Apache calls it automatically based on the .php extension (I think that CGI can run this way as well). Thus, the #! line is not needed and might cause issues if used (haven't tried it).

 

2. The line would change based on the host that installed it. I would assume that your host is correct about where it is installed on their system, but either #!/usr/bin/php (Debian or Red Hat) or #!/opt/php/bin (LSB compliant) would also be reasonable install locations.

 

I would be somewhat leary of a host that opened with something like this. Maybe they're great otherwise, but if you're just getting started, why take the chance? Many hosts are accustomed to osCommerce and it will run out of the box (try the Pair link in the upper right corner as an example).

 

Hth,

Matt

Link to comment
Share on other sites

Well, the people hosting the site are the university web server admins... apparently I'm the first person that wanted to install 3rd party PHP scripts... My store is part of the university bookstore.

 

Because of this, I'm probably stuck with this server unless I build and administer my own, which isn't gonna be approved by upper management..

 

sigh

 

Still, I can't find the options to set if php is installed as CGI. Can anybody point me to the documentation that goes over these details?

 

thanks

Link to comment
Share on other sites

  • 1 year later...

#!/usr/bin/php everywhere!

 

I have the same problem with my host ( interland ). I added #!/usr/bin/php to every page and as seen above it prints everywhere.

 

Seems that if you call it once, you are good, call it again and it prints instead.

 

I did remove it from all of the includes. now it is Almost everywhere.

 

The install went lovely with 0 problems once i added the line to the three files. Once i went to admin it was awash with #!/usr/bin/php .

 

A workaround would help. I keep checking back.

Link to comment
Share on other sites

#!/usr/bin/php everywhere!

 

I have the same problem with my host ( interland ). I added #!/usr/bin/php to every page and as seen above it prints everywhere.

 

Seems that if you call it once, you are good, call it again and it prints instead.

 

I did remove it from all of the includes. now it is Almost everywhere.

 

The install went lovely with 0 problems once i added the line to the three files. Once i went to admin it was awash with #!/usr/bin/php .

 

A workaround would help. I keep checking back.

 

Works like a charm, I removed the #!/usr/bin/php line as well as any whitespace from all but the admin and catalog directory. So far is well Now i can get to work.

 

Looks good! Thanks to the creators and contributors. Hopefully i will soon join the ranks.

 

g.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...