PHP error on new installation

PHP error on new installation

by michael sanderson -
Number of replies: 5

Using Moodle 2.7 (NOT latest - though the same error happened with that version), I am getting the following when attempting to run the initial install:

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home1/mandjnc1/public_html/class/index.php on line 79

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home1/mandjnc1/public_html/class/index.php on line 79

Parse error: syntax error, unexpected T_STRING in /home1/mandjnc1/public_html/class/index.php on line 79


I'm using Hostgator as my provider and my initial thoughts is that this is a problem with the PHP version?


Michael


Average of ratings: -
In reply to michael sanderson

Re: PHP error on new installation

by john Simpson -

From what source did you install Moodle. Was it from the Hostgater control panel? Also can you upgrade your PHP from this control panel?


In reply to john Simpson

Re: PHP error on new installation

by michael sanderson -

I installed manually from the source obtained from moodle AND hostgator with the same error. Hostgator has PHP 5.4 installed which is compatible with 2.7

In reply to michael sanderson

Re: PHP error on new installation

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Michael,
that PHP error means that you're running a PHP version not supporting namespaces i.e. < 5.3.0. Please, double check the PHP version issue with Hostgator tech support.

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: PHP error on new installation

by john Simpson -
Speaking as someone with recent experiences and definitely not as a moodle expert. If you can't have your PHP upgraded with hostgater, go to moodle download section, go down the list and choose a moodle that states the minimum php version that your hostgater has. It appears you need to download moodle 2.0.10. 

I had problems with my previous web host, who refused to upgrade the php and stated that moodle was too much for them to handle. I changed my web host where with them, I basically pressed one install moodle button and got moodle fully installed. Just the way it should be.

Many webhosts now have moodle listed in their control panel as cgi scripts, or listed under applications. But some don't install, or you will have an old version of moodle. So from past experiences I ask readers to chose your web host wisely, and don't commit yourself to paying any more than a monthly payment. Most certainly don't commit yourself to a yearly contract.