ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

EE not working with php 5?

March 29, 2009 1:55pm

Subscribe [4]
  • #1 / Mar 29, 2009 1:55pm

    Colin Lewis

    55 posts

    I am moving a site to a new web host Canvas Dreams and ran into some trouble. The host is actually moving the site for me, and apparently both the front and back ends weren’t working. I just received a notice from the host saying:

    “We were not aware that your site required PHP4-style code. The hosting environment we provide defaults to PHP5, though we do offer version 4 for legacy code sites.”

    They run the latest php version, 5.2.something. The site works now because they downgraded the site’s php to 4, but I still don’t understand - I thought EE worked with the latest php? Have I or the web host misunderstood something?

    Thanks for your help!
    Colin

    PS - btw, Canvas Dreams seems like an excellent green host if anyone’s interested.

  • #2 / Mar 29, 2009 1:59pm

    Ingmar

    29245 posts

    Whatever it was/is, EE certainly runs on (even though it does not actually require) PHP 5. All my sites are running on some variant of PHP 5.

  • #3 / Mar 29, 2009 2:01pm

    Greg Aker

    6022 posts

    Colin:

    I run all my sites on PHP 5.2.6 with no problem.  I would download the server wizard to make sure everything needed is supported on the server.

    How was it ‘not working’?

    -greg

  • #4 / Mar 29, 2009 2:28pm

    Colin Lewis

    55 posts

    Unfortunately, I never got to see how it wasn’t working although my colleague said all the links were dead on the index, and she was unable to open any other pages. Good to know that EE wasn’t at fault; I knew it couldn’t be true!

    I’ll investigate and report back if I discover anything. Thanks for your quick responses.
    /Colin

  • #5 / Mar 29, 2009 2:29pm

    Colin Lewis

    55 posts

    @Greg - good advice about the server wizard; thanks.

  • #6 / Mar 29, 2009 2:31pm

    Greg Aker

    6022 posts

    Colin:

    Do you mean that the links on the rendered home page wouldn’t go anywhere?  If so that means the host is running php as a CGI, therefore you need to Force Query Strings at:  CP Home ›  Admin ›  System Preferences ›  Output and Debugging Preferences. 

    Has not to do with the php version, but running it as a CGI Process, not Apache Module (which I personally find less than optimal)

    -greg

  • #7 / Mar 29, 2009 3:08pm

    Colin Lewis

    55 posts

    Wow, that’s an idea. I’ve just sent that question to Canvas Dreams support; we’ll see what they say. Thanks.

    Why would running php as CGI be less than optimal?
    /Colin

  • #8 / Mar 29, 2009 3:18pm

    Ingmar

    29245 posts

    The obvious advantage of using PHP as a module is speed: running PHP as a CGI means that you basically tell your web server the location of the PHP executable file, and the server runs that executable, giving it the script you called, each time you visit a page. That means each time you load a page, PHP needs to read php.ini and set its settings, it needs to load all its extensions, and then it needs to start work parsing the script - there is a lot of repeated work.

    When you run PHP as a module, PHP literally sits inside your web server - it starts only once, loads its settings and extensions only once, and can also store information across sessions. For example, PHP accelerators rely on PHP being able to save cached data across requests, which is impossible using the CGI version.

  • #9 / Apr 08, 2009 9:13am

    thriva

    24 posts

    Many Thanks

    I had a very similar experience… my host installed PHP5 and suddenly my site stopped working in exactly the same way. I updated to the latest version of EE but it was just the same. I’m very happy to say that reading this thread has solved the problem and I now know that it’s because php is running as a CGI… this issue is described in the installation troubleshooting documentation but the solution Greg mentions in post#5 is not. Why is that? It must be fairly common.

  • #10 / Apr 08, 2009 10:02am

    Ingmar

    29245 posts

    Needing to “force query strings” is quite common, it’s true, but it doesn’t only happen when running PHP as CGI (nor am I 100% sure that running PHP as CGI will invariably require it). It’s just another trouble shooting step.

  • #11 / Apr 08, 2009 10:19am

    thriva

    24 posts

    The link on the Installation Troubleshooting page points to the wrong Knowledge-Blog entry.
    Everything is clear now. Thanks.

  • #12 / Apr 08, 2009 1:03pm

    Sue Crocker

    26054 posts

    Colin, which link? I’ll be happy to fix it.

  • #13 / Apr 08, 2009 1:21pm

    thriva

    24 posts

    http://expressionengine.com/docs/installation/troubleshooting.html

    Where it says: this Knowledge-Blog entry
    This takes you to “How many custom fields can my installation support” instead of “Main page content appears on every page….”

  • #14 / Apr 08, 2009 3:10pm

    Lisa Wess

    20502 posts

    Thanks for the report, thriva.  I’ll get that fixed up. =)

  • #15 / Apr 11, 2009 7:26am

    Colin Lewis

    55 posts

    It turns out my host was just a little unfamiliar with EE…everything now works as expected in php5. Thanks everyone for your help.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases