PrestaShop Forums: Parse error unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR - PrestaShop Forums

Jump to content


Welcome to the PrestaShop Forum! We hope you'll share your comments and suggestions with us. We ask that you please post in English to the main sections of the PrestaShop Forum. If you want to write in another language, please post in the corresponding PrestaShop Community section below.

Please note that PrestaShop Community sections are largely self-moderated. PrestaShop team members may or may not participate in non-English sections. To improve the chances of receiving feedback to your question or comment, please post it in English to the main sections of our Forum.

NYC

Vous parlez français ? par ici !


Parse error unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR


Parse error unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR

#1 .Danny

    PrestaShop Newbie

  • 02 Mar 2008
  • Members
  • Pip
  • 5 posts

Posted 02 March 2008 - 11:16 AM

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 :D .
Danny.

#2 .Danny

    PrestaShop Newbie

  • 02 Mar 2008
  • Members
  • Pip
  • 5 posts

Posted 04 March 2008 - 12:48 PM

Anyone?

#3 Peter Wilson

    PrestaShop Addict

  • 26 Oct 2007
  • Members
  • PipPipPip
  • 692 posts
  • Location:Paris, France

Posted 04 March 2008 - 01:22 PM

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.prestasho...opic,966.0.html
Help PrestaShop, make a donation ![/size]

#4 .Danny

    PrestaShop Newbie

  • 02 Mar 2008
  • Members
  • Pip
  • 5 posts

Posted 04 March 2008 - 11:20 PM

Thankyou for the reply,
But I'm pretty sure I'm running php5 ???

#5 Peter Wilson

    PrestaShop Addict

  • 26 Oct 2007
  • Members
  • PipPipPip
  • 692 posts
  • Location:Paris, France

Posted 04 March 2008 - 11:48 PM

First, check this list of hosting servers to see if you need to activate PHP5 manually via an .htaccess file:

http://www.prestasho...opic,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 :)
Help PrestaShop, make a donation ![/size]

#6 .Danny

    PrestaShop Newbie

  • 02 Mar 2008
  • Members
  • Pip
  • 5 posts

Posted 05 March 2008 - 03:54 PM

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 :D

Edit: Did I pin this?  ???

#7 Peter Wilson

    PrestaShop Addict

  • 26 Oct 2007
  • Members
  • PipPipPip
  • 692 posts
  • Location:Paris, France

Posted 06 March 2008 - 11:22 AM

Hi Danny,

No, I did.  This is a very commonly reported error, so I changed the title and pinned it for greater visibility. :)
Help PrestaShop, make a donation ![/size]

#8 tekstylez

    PrestaShop Newbie

  • 28 Apr 2008
  • Members
  • Pip
  • 6 posts

Posted 29 April 2008 - 03:53 AM

Quote

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 :D

Edit: Did I pin this?  ???


Mind sharing how you updated to php5?

#9 .Danny

    PrestaShop Newbie

  • 02 Mar 2008
  • Members
  • Pip
  • 5 posts

Posted 29 April 2008 - 12:43 PM

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.prestasho...opic,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.

#10 colderthanice

    PrestaShop Newbie

  • 10 May 2008
  • Members
  • Pip
  • 1 posts
  • Location:Turkey

Posted 10 May 2008 - 05:31 PM

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.  :D 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.co...p5-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.

#11 dr770

    PrestaShop Apprentice

  • 12 May 2008
  • Members
  • PipPip
  • 28 posts

Posted 12 May 2008 - 01:44 PM

i'm runing php5 on mediatemple gs hosting.
register globals on.

getting that error.

help?

#12 Bruno Lévêque

    PrestaShop Fanatic

  • 03 Aug 2007
  • PrestaTeam
  • 1083 posts
  • Location:Miami, FL

Posted 12 May 2008 - 02:53 PM

Quote

i'm runing php5 on mediatemple gs hosting.
register globals on.

getting that error.

help?


Please could you post the result of phpinfo() ?
Bruno LévêquePrestashop Co-founder (Co-fondateur)PrestaShop



#13 dr770

    PrestaShop Apprentice

  • 12 May 2008
  • Members
  • PipPip
  • 28 posts

Posted 12 May 2008 - 05:25 PM

thank you for response.
the hostingserver interface didnt swithched to php5 properly at the first time.
now it works fine.

thank you!

#14 Ann

    PrestaShop Apprentice

  • 02 Jul 2008
  • Members
  • PipPip
  • 363 posts

Posted 10 July 2008 - 07:58 AM

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 informatician

She is BLONDE !!!

Thank you ! ;-))
www.ann-secrets.com
www.mode-des-femmes.com

#15 Ann

    PrestaShop Apprentice

  • 02 Jul 2008
  • Members
  • PipPip
  • 363 posts

Posted 10 July 2008 - 06:50 PM

From 1215673125:

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 informatician

She is BLONDE !!!

Thank you ! ;-))



Eventually, I managed by MYSELF !!!! ( topic closed )
www.ann-secrets.com
www.mode-des-femmes.com

#16 Learn To Tattoo

    PrestaShop Newbie

  • 24 Aug 2008
  • Members
  • Pip
  • 13 posts
  • Location:Sheffield - UK

Posted 24 August 2008 - 06:03 AM

Just to clarify this issue in a simple way.

In your main prestashop folder, there is a file named htaccess.txt

Add 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 .htaccess

Note the . before it, and also remove the extension .txt from the end.

Hope this helps anyone who isnt that familiar with htaccess files.
=======================================================
Learn How To Tattoo Course
:-)

#17 dunweb

    PrestaShop Newbie

  • 09 Sep 2008
  • Members
  • Pip
  • 3 posts

Posted 09 September 2008 - 01:07 AM

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

#18 dunweb

    PrestaShop Newbie

  • 09 Sep 2008
  • Members
  • Pip
  • 3 posts

Posted 09 September 2008 - 01:31 AM

Disregard, I found some answers in another sticky.

Thanks


Chris

#19 imissu

    PrestaShop Newbie

  • 15 Oct 2008
  • Members
  • Pip
  • 2 posts

Posted 15 October 2008 - 07:53 AM

I got the same problem,

it's now work by switching to php5 from php configuration in my cpanel....

Posted Image

thanks

#20 bobmane

    PrestaShop Newbie

  • 04 Dec 2008
  • Members
  • Pip
  • 2 posts

Posted 04 December 2008 - 12:32 PM

the posted solutions did not work for me


I am at 1&1;and it is PHP 5


i uploaded htaccess:

AddType x-mapp-php5 .php4
AddHandler x-mapp-php5 .php4


and also tried this:

SetEnv DEFAULT_PHP_VERSION 5
# 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 [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 errors
ErrorDocument 404 /404.php



same error

/install/classes/LanguagesManager.php on line 7





i have a Magento store working on the same server so Im not sure its as easy as blaming 1and1.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users