.Danny Posted March 2, 2008 Share Posted March 2, 2008 Hello, Sorry to be so rude and just turn up here, But I am very pressed for time. I tried to install your software on my webserver but I get these errors and I'm not sure why. Would someone here mind helping me out? This one is from the index (/store) Parse error: parse error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/content/D/html/candycoreclothing/store/classes/Tools.php on line 23 And this is from the install (store/install) Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/content/D/html/candycoreclothing/store/install/classes/LanguagesManager.php on line 7 Thankyou so much for any help given . Danny. Link to comment Share on other sites More sharing options...
.Danny Posted March 4, 2008 Author Share Posted March 4, 2008 Anyone? Link to comment Share on other sites More sharing options...
Peter Wilson Posted March 4, 2008 Share Posted March 4, 2008 Hi .Danny, First of all, welcome to the PrestaShop Forum That error is due to the fact that PrestaShop cannot run on anything older than PHP5. Please check this thread for more details: http://www.prestashop.com/forum/index.php/topic,966.0.html Link to comment Share on other sites More sharing options...
.Danny Posted March 4, 2008 Author Share Posted March 4, 2008 Thankyou for the reply, But I'm pretty sure I'm running php5 ??? Link to comment Share on other sites More sharing options...
Peter Wilson Posted March 4, 2008 Share Posted March 4, 2008 First, check this list of hosting servers to see if you need to activate PHP5 manually via an .htaccess file: http://www.prestashop.com/forum/index.php/topic,714.0.html If that doesn't work, can you tell us which version of PHP 5 you're using? For example, PHP 5.0.5 or PHP 5.2.4 ? Thanks Link to comment Share on other sites More sharing options...
.Danny Posted March 5, 2008 Author Share Posted March 5, 2008 After a closer look I see I have PHP 4.3.11 :-X Sorry about that. Updated to PHP 5 and all is working so far Edit: Did I pin this? ??? Link to comment Share on other sites More sharing options...
Peter Wilson Posted March 6, 2008 Share Posted March 6, 2008 Hi Danny, No, I did. This is a very commonly reported error, so I changed the title and pinned it for greater visibility. Link to comment Share on other sites More sharing options...
tekstylez Posted April 29, 2008 Share Posted April 29, 2008 After a closer look I see I have PHP 4.3.11 :-X Sorry about that. Updated to PHP 5 and all is working so far Edit: Did I pin this? ??? Mind sharing how you updated to php5? Link to comment Share on other sites More sharing options...
.Danny Posted April 29, 2008 Author Share Posted April 29, 2008 Sure. If you have a shared sever then you just have to enable it (like I had to do). Google is your friend, but I just saw this below this topic: http://www.prestashop.com/forum/index.php/topic,714.0.html But, if you own your own server, you will have to install it (I don't know how to do this, but I'm sure google does ) I hope I helped. - Danny. Link to comment Share on other sites More sharing options...
colderthanice Posted May 10, 2008 Share Posted May 10, 2008 This is absolutly php4 problem. Whe we try to install Pretashop on php 4.x than firstly we recognise our domain not forwarding to install directory. So we are trying www.example.com/install but we saw parse error. There is two solution for this problem. 1. Your host must upgrade php 5.x 2. Using php5-cgi file I am using php5-cgi and everything seems ok for now. Because my host isn't changing or upgrading php version for me So a lot of person want to know how to use php5-cgi ??? I have learnt this solution from another e-shop solution's forum. Step by step application. 1- Download php5-cgi.zip from rapidshare ( http://rapidshare.com/files/113942560/php5-cgi.zip.html ) 2- Extract the file 3- From your ftp software (filezilla,cuteftp ... ) login your file server 4- In the www root you can see cgi-bin directory but my best way is you to crate another CGI named directory. 5- Upload extracted file to that directory. 6- Create or change .htaccess file and write these codes. # start code HTACCESS <IfModule mod_php5.c> php_flag magic_quotes_gpc off php_flag short_open_tag on </IfModule> DirectoryIndex index.php Action php5-cgi /cgi/php5-cgi AddHandler php5-cgi .php # URL rewriting module activation RewriteEngine on # URL rewriting rules RewriteRule ^([0-9]+)-([a-zA-Z0-9-]*).html(.*)$ product.php?id_product=$1$3 [L,E] RewriteRule ^([0-9]+)-([a-zA-Z0-9-]*)(.*)$ category.php?id_category=$1$3 [L,E] # Catch 404 errors ErrorDocument 404 /404.php # End Code HTACCESS 7- Than upload .htacces to your root directory 8- You can explore your domain (www.example.com) will forward www.example.com/install I think everything will ok. But then you have to read and manage standart prestashop installation steps. Link to comment Share on other sites More sharing options...
dr770 Posted May 12, 2008 Share Posted May 12, 2008 i'm runing php5 on mediatemple gs hosting. register globals on. getting that error. help? Link to comment Share on other sites More sharing options...
Bruno Leveque Posted May 12, 2008 Share Posted May 12, 2008 i'm runing php5 on mediatemple gs hosting. register globals on. getting that error. help? Please could you post the result of phpinfo() ? Link to comment Share on other sites More sharing options...
dr770 Posted May 12, 2008 Share Posted May 12, 2008 thank you for response. the hostingserver interface didnt swithched to php5 properly at the first time. now it works fine. thank you! Link to comment Share on other sites More sharing options...
Ann Posted July 10, 2008 Share Posted July 10, 2008 Hello all,I' ve tried all solutions given here, but still didn't manage to make it... it seems I didn't manage to switch to php5 although many attemps . My host is online.net and I tried their hotline . Their only answer ( helpfull ! lol ) was that if I didn't get php5 was because I didn' t manage to switch it on ! ( just great, when you don't need anything, just call them ! ).There is probably something I am doing wrong, but I don't know what...can any one be kind enough to take the time to explain things to a poor little shop attendant who has two main defects :She is no informaticianShe is BLONDE !!! Thank you ! ;-)) Link to comment Share on other sites More sharing options...
Ann Posted July 10, 2008 Share Posted July 10, 2008 Hello all,I' ve tried all solutions given here, but still didn't manage to make it... it seems I didn't manage to switch to php5 although many attemps . My host is online.net and I tried their hotline . Their only answer ( helpfull ! lol ) was that if I didn't get php5 was because I didn' t manage to switch it on ! ( just great, when you don't need anything, just call them ! ).There is probably something I am doing wrong, but I don't know what...can any one be kind enough to take the time to explain things to a poor little shop attendant who has two main defects :She is no informaticianShe is BLONDE !!! Thank you ! ;-)) Eventually, I managed by MYSELF !!!! ( topic closed ) Link to comment Share on other sites More sharing options...
Davey Posted August 24, 2008 Share Posted August 24, 2008 Just to clarify this issue in a simple way.In your main prestashop folder, there is a file named htaccess.txtAdd the following in the very first line of the file. SetEnv DEFAULT_PHP_VERSION 5 Now reupload the htaccess.txt file.Now the file is on the server, rename that file to .htaccessNote the . before it, and also remove the extension .txt from the end.Hope this helps anyone who isnt that familiar with htaccess files. Link to comment Share on other sites More sharing options...
dunweb Posted September 9, 2008 Share Posted September 9, 2008 Ok,I am new to Prestashop as I have always used OSC. However, I decided to learn more about PrestaShop because of the nice GUI that would allow my customers to access the admin side and make their own changes easily.My problem is, I am still getting the Parse error even after making the changes suggested in this thread. If I alter the .htaccess file it comes up with an error 500 (internal server error) when I try to install Prestashop. Is anyone else using godaddy.com to host a prestashop ? if so, was there anything special needed ???Thanks in advance.Chris Link to comment Share on other sites More sharing options...
dunweb Posted September 9, 2008 Share Posted September 9, 2008 Disregard, I found some answers in another sticky.ThanksChris Link to comment Share on other sites More sharing options...
imissu Posted October 15, 2008 Share Posted October 15, 2008 I got the same problem,it's now work by switching to php5 from php configuration in my cpanel....thanks Link to comment Share on other sites More sharing options...
bobmane Posted December 4, 2008 Share Posted December 4, 2008 the posted solutions did not work for meI am at 1&1;and it is PHP 5i uploaded htaccess: AddType x-mapp-php5 .php4AddHandler x-mapp-php5 .php4and also tried this:SetEnv DEFAULT_PHP_VERSION 5# URL rewriting module activationRewriteEngine on# URL rewriting rulesRewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ product.php?id_product=$1$3 [L,E]RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ category.php?id_category=$1 [QSA,L,E]RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ supplier.php?id_supplier=$1$3 [QSA,L,E]RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ manufacturer.php?id_manufacturer=$1$3 [QSA,L,E]# Catch 404 errorsErrorDocument 404 /404.phpsame error/install/classes/LanguagesManager.php on line 7i have a Magento store working on the same server so Im not sure its as easy as blaming 1and1. Link to comment Share on other sites More sharing options...
1959 Posted December 11, 2008 Share Posted December 11, 2008 I am hosted with 1&1;. I have a shared package.Here is info for changing to php5.http://faq.1and1.com/scripting_languages_supported/php/upgrade/6.htmlIt says By default Apache uses PHP 4 for .php extension. If you don't want to rename all yourscripts to .php5 you can do the following:Create a .htaccess file and place the following line AddType x-mapp-php5 .php in it.This will tell Apache to use PHP 5 instead of PHP 4 for the extension .php in thedirectory the .htaccess is placed and all sub-directories under it. Link to comment Share on other sites More sharing options...
tcharara Posted May 5, 2009 Share Posted May 5, 2009 Hello,After installing Prestashop successfully on my personal website (@ Amen.fr) I'm trying to do this for a client who is at Thunderhosting.org.PHP is 5.2.9 as per the general server information. I could not get past the "parse error unexpected T_STATIC… error, until I changed the .htaccess file to:AddType x-mapp-php5 .php# URL rewriting module activationRewriteEngine on# URL rewriting rulesRewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ product.php?id_product=$2$4 [L,E]RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ product.php?id_product=$1$3 [L,E]RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ category.php?id_category=$1 [QSA,L,E]RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ cms.php?id_cms=$1 [QSA,L,E]RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ supplier.php?id_supplier=$1$3 [QSA,L,E]RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ manufacturer.php?id_manufacturer=$1$3 [QSA,L,E]# Catch 404 errorsErrorDocument 404 /404.phpThat got rid of the error, now I get an installation window with lot's of code (see jpeg) and have no clue as to what is to be done now! I would be thankful for your suggestions!Thanks,Tarek Link to comment Share on other sites More sharing options...
tcharara Posted May 6, 2009 Share Posted May 6, 2009 :-) I found the answer to my problem.It seems that although Thunderhost.org indicates php 5 as active, the default is php 4.My cpanel configuration (or version) did not allow the end user to change the php configuration - this has been changed ovrnight. Everything works as expected. Link to comment Share on other sites More sharing options...
rizham Posted February 9, 2010 Share Posted February 9, 2010 hat error is due to the fact that PrestaShop cannot run on anything older than PHP5 Link to comment Share on other sites More sharing options...
ondrovic Posted March 25, 2010 Share Posted March 25, 2010 I get this error when trying to install a module, it could be that I am trying to write the module and doing something wrong Parse error: syntax error, unexpected T_STRING in /home/chrellis/public_html/classes/Module.php(325) : eval()'d code on line 49Parse error(s) in module(s) 1. socialbookmarks I did check to make sure that php 5 is installed a correctly working and it isAny ideas or am I in the wrong thread for this problem?Thanks Link to comment Share on other sites More sharing options...
sp2000 Posted June 30, 2010 Share Posted June 30, 2010 Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in C:\AppServ\www\pshop\install\classes\ToolsInstall.php on line 4I got an above error when I install the program.I have checked my php version is MySQL client version: 3.23.49Server version: 5.0.45-community-nt-logCan any tell me what the problem is?Thanks a lotSteve Link to comment Share on other sites More sharing options...
yangxiong40 Posted March 15, 2011 Share Posted March 15, 2011 I agree with the above statement. Good point!Everyone’s views are different, so opinions are not the same.Bing or Google may help you. Have a try! Link to comment Share on other sites More sharing options...
pozz Posted April 3, 2011 Share Posted April 3, 2011 HiI get this error aswell and have tried everything I have found but whitout success.Cleared cookies.Have php5I cant see the .htaccess or the cgi bin on the server, that might be a problem?Anyone else have any ideas?regards Link to comment Share on other sites More sharing options...
gmanpresto Posted September 11, 2011 Share Posted September 11, 2011 Hello, Sorry to be so rude and just turn up here, But I am very pressed for time. I tried to install your software on my webserver but I get these errors and I'm not sure why. Would someone here mind helping me out? This one is from the index (/store) Parse error: parse error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/content/D/html/candycoreclothing/store/classes/Tools.php on line 23 And this is from the install (store/install) Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/content/D/html/candycoreclothing/store/install/classes/LanguagesManager.php on line 7 Thankyou so much for any help given . Danny. Link to comment Share on other sites More sharing options...
benjamin utterback Posted October 24, 2012 Share Posted October 24, 2012 Hello, this error does not seem to be consistent with the recent versions of PrestaShop, I will unPin this topic. Link to comment Share on other sites More sharing options...
lalit Posted August 15, 2015 Share Posted August 15, 2015 PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_FUNCTION in /hermes/bosnaweb03a/b2758/ipg.delhibrandscom1/override/classes/Dispatcher.php on line 26 I'm getting this error after install and uninstall one module. 'cleanurl' Any suggetion? Link to comment Share on other sites More sharing options...
ebclr Posted August 27, 2017 Share Posted August 27, 2017 This is a well known bug/situation in PrestaShop.PrestaShop tries to manually copy class methods to \override\classes\* files, and sometimes the lines miss-match or the line break are wrong, and the end result is incorrectly copied lines which cause syntax errors. That happens both on installation and uninstallation.you need to rename the file Dispatcher.php to Dispatcher.php_ORIG and your application will work as intended. Please clear your browser's cache and verify on your end. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now