Zen Cart Logo
Forums / General Questions / Running PHP as CGI

Running PHP as CGI

Locked

Views: 2,367

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
7 Mar 2008, 2:51 PM
#1
hduk avatar

hduk

New Zenner

Join Date:
Jan 2008
Posts:
30
Plugin Contributions:
0

Running PHP as CGI

Hey All,

Im running zen 1.3.8 in a linux environment on mysql5.

Im getting a strange issue with the website intermittently going to the standard "page cannot be displayed" message. I am struggling to pinpoint the root cause as to me it seems like a webserver error.

Occasionally i get the zen screen where it refers to there being a problem with the site which im guessing is a problem connecting to the database, ive not seen this since changing the mysql target to ip rather than hostname.

Can anyone shed any light on the "page cant be displayed" issue.

Could this be a result of running php in cgi mode or would i get a different symptom?

7 Mar 2008, 2:55 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Running PHP as CGI

php or cgi - if your cart is setup correctly neither of these should be the issue -additionally you should not have to be using IP if the nameservers are correctly set.

7 Mar 2008, 6:28 PM
#3
hduk avatar

hduk

New Zenner

Join Date:
Jan 2008
Posts:
30
Plugin Contributions:
0

Re: Running PHP as CGI

other than using the ip instead of hostname everything else is default. any suggestions on troubleshooting.

7 Mar 2008, 6:39 PM
#4
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Running PHP as CGI

Permission, permission. On my host running as CGI you need to set folder to 755 and files to 644. This requirement may be different from host to host, check with your host, see what they have to say.

7 Mar 2008, 9:04 PM
#5
hduk avatar

hduk

New Zenner

Join Date:
Jan 2008
Posts:
30
Plugin Contributions:
0

Re: Running PHP as CGI

would the symptom be present all the time if it was permissions? rather than intermittent?

7 Mar 2008, 9:28 PM
#6
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Running PHP as CGI

If its permissions then Yes it would be all the time,
but only for the pages that have bad permissions set,
for instance in the admin
if you have the configure.php set to 777 then then whole admin is trashed because every page uses the config page

however if you only had the permissions bad on say orders.php then ONLY the orders.php file would be trashed.....

so if its the same links that are trashed all the time then yes, if its truely intermontent then I would so no its not a permissions issue

7 Mar 2008, 11:05 PM
#7
hduk avatar

hduk

New Zenner

Join Date:
Jan 2008
Posts:
30
Plugin Contributions:
0

Re: Running PHP as CGI

the problem can occur on the same page i.e if i select a particular category and view the first page when i come back to that page or refresh it a few times it will time out. Makes me think its more of a keepalives issue rather than permissions but im not an expert by any means on linux based servers. I havent tampered with the install either its a pretty much standard install with the exception of adding a few modules.

It does present itself more frequently if im in the admin area, ive been populating the site using ep an near enough every time i input a file the page will time out, a few refreshes later it comes back and the products are added fine. I have logged a call with my hosting provider but they have checked my mysql server and webhost with no issues. :( I was hoping to make it all live by the end of the weekend.

8 Mar 2008, 12:48 AM
#8
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: Running PHP as CGI

If you change from using an IP to using your Domain name, you should find these problems will go away. If they don't then the problem is with your Hosting services.

8 Mar 2008, 10:39 AM
#9
hduk avatar

hduk

New Zenner

Join Date:
Jan 2008
Posts:
30
Plugin Contributions:
0

Re: Running PHP as CGI

I was using the domain name initially but when i started getting the timeouts suspected a DNS issue to changed to using the IP but this didn't resolve the issue.

The host im using does support oscommerce so im guessing there should be no issues with zen particularly as when you search for zen hosting they come up as a sponsored link.

Ill refer it back to them.

Cheers everyone for the advice, if anyone has any other suggestions let me know as im desparate to launch

8 Mar 2008, 10:51 AM
#10
hduk avatar

hduk

New Zenner

Join Date:
Jan 2008
Posts:
30
Plugin Contributions:
0

Re: Running PHP as CGI

Forgot to add to my last post that initially the templates werent displaying and someone suggested eliminating the htaccess files from the main and admin sites. This fixed the template issue however could this be causing the timeouts?

8 Mar 2008, 4:59 PM
#11
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Running PHP as CGI

please remember that OSC and zen cart are far from the same anymore,

and just because someone pays for a link on google, dosnt mean that they actually support ZC

you should try using local host to call the database ( as long as its on the same server )

8 Mar 2008, 5:37 PM
#12
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: Running PHP as CGI

hduk:

Forgot to add to my last post that initially the templates werent displaying and someone suggested eliminating the htaccess files from the main and admin sites. This fixed the template issue however could this be causing the timeouts?
Not a good idea to remove as they do have specific purposes. They are pretty generic as far using on any Server and should not cause you problems.

If you are having database timeouts and / or problems displaying pages -- regardless of Template used -- it could be indicating underlying problems with the Hoster; overloaded Servers or not using their setup as intended. For example you mention that PHP is run as CGI. This means no .htaccess files can have reference to PHP and this is true with the default .htaccess files supplied with Zen Cart. However, if you have manually added to any .htaccess file but it was not done correctly, this would lead to problems.

In these type situations it is always best to discuss the issue with your Hoster. Nobody is more familiar with your Hosting services than they are. :wink:

8 Mar 2008, 6:19 PM
#13
hduk avatar

hduk

New Zenner

Join Date:
Jan 2008
Posts:
30
Plugin Contributions:
0

Re: Running PHP as CGI

hey rob, very true, trouble is they dont seem to have a clue what they are doing. Clock is ticking and i need to be running. Im thinking i need to transfer to a zen friendly host.

Can anyone suggest a good one (pm me if this isn't openly permitted to suggest). I dont mind if it is offshore as long as the performance is good enough to serve access from the uk.

merlin unfortunately the web server is on a different server to mysql, i have also tried databases on other servers within the same isp with the same result.

i think performance could well be the issue due to the intermittent nature of the fault, guess there is no real cure for that if it is a hosted solution unless they have a server under less load they can move me to :(

8 Mar 2008, 6:46 PM
#14
steven300 avatar

steven300

Totally Zenned

Join Date:
Jan 2008
Posts:
1,564
Plugin Contributions:
1

Re: Running PHP as CGI

hduk:

Can anyone suggest a good one

Just sent you a PM

8 Mar 2008, 8:34 PM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Running PHP as CGI

hduk:

Im thinking i need to transfer to a zen friendly host.

Can anyone suggest a good one (pm me if this isn't openly permitted to suggest).Several good recommendations on this site ... click "hosting" at the top of this page.