Welcome to Geeklog Thursday, December 05 2019 @ 03:06 pm EST

Geeklog Forums

Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$


Status: offline

1PLM

Forum User
Chatty
Registered: 11/07/08
Posts: 39
I just did a new install for Mysite.com. Geeklog recommended configuring plugins for new install, when I try to continue i get the following error. What am I missing? Below is the on screen message. Thanks.
Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in Mysite.com/plugins/staticpages/services.inc.php on line685
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/02
Posts: 13073
Location:Stuttgart, Germany
You are trying to install Geeklog 1.7.1 on a server with PHP 4. That should work in theory, but in practice, there is a bug in the Static Pages plugin, since it accidentally contains some code that only works on PHP 5.

If you can, switch to using PHP 5. Otherwise, you'll have to wait for Geeklog 1.7.2 (or go back to 1.6.1sr2).

bye, Dirk
 Quote

Status: offline

1PLM

Forum User
Chatty
Registered: 11/07/08
Posts: 39
I realized after the install that I may need PHP5 and thus changes my server settings to have the default as PHP5 but the error is still there. Is it too late after the install to change my default PHP4.9 to PHP5 or Do I need to do a new Install? Thanks.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/02
Posts: 13073
Location:Stuttgart, Germany
Switching to PHP 5 should fix that error. Double-check that you really are on PHP 5 now.

There's an info.php script in admin/install that you can call up. It'll display the PHP 5 version, among other things.

bye, Dirk
 Quote

Status: offline

1PLM

Forum User
Chatty
Registered: 11/07/08
Posts: 39
Dirk,
Thanks for your prompt feedbacks. I realized the settings I changed for PHP (from 4.9.9 to 5) affected a different directory on my server. I reset the entire Geeklog directory to Enabled for PHP 5 and now the "Parse Error" is gone but I get the following message instead,"Oops the link appears to be broken" When I go back to continue installation. (the admin/install/index.php exists at it's location). Also When I rechecked the admin/install/info.php it shows: <?php phpinfo(); ?>
What do I do now?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/02
Posts: 13073
Location:Stuttgart, Germany
The "Oops" message is not something Geeklog would display, so not sure where that is coming from.

If you get the source code of a PHP script displayed, then PHP is not running at all. See if you can get it going again or try contacting your hosting service.

Btw, this (PHP not running and displaying the source code instead) is one of the security risks with having your db-config.php file accessible from the web. Anyone can see your database password now ...

bye, Dirk
 Quote

Status: offline

1PLM

Forum User
Chatty
Registered: 11/07/08
Posts: 39
@ Dirk: Are you saying my Dbase password is now visible per my post? I will provide feedback/status update later.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/02
Posts: 13073
Location:Stuttgart, Germany
In another post, you mentioned that you put your db-config.php in your webroot and that Geeklog's security check gave you a warning about that. If PHP is not interpreted now, then calling up example.com/db-config.php would display the contents of that file, including your db password.

bye, Dirk
 Quote

Status: offline

1PLM

Forum User
Chatty
Registered: 11/07/08
Posts: 39
Sorryfor the confusion but that post related to another Geeklog site of mine running version 1.6. When you try to access example.com/db.config.php it says: This file can not be used on its own! so I am thinking it cannot be accessed via http.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/02
Posts: 13073
Location:Stuttgart, Germany
Quote by: 1PLM[pWhen you try to access example.com/db.config.php it says: This file can not be used on its own! so I am thinking it cannot be accessed via http.[/p]

Actually, that proves that it can be accessed via http. As long as PHP is interpreted, it will display this message. If not (which apparently happened on your other site), then it would display the entire content of that file, i.e. the PHP code and your db password.

Granted, that's a rare and temporary case (usually), but why take the risk?

bye, Dirk
 Quote

Status: offline

1PLM

Forum User
Chatty
Registered: 11/07/08
Posts: 39
Thanks a lot.I I have read and learned.
 Quote

q

Anonymous
Tried to install GL 1.7.2 with PHP 4.4.9 and got the following:

Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in /homepages/36/d136911130/htdocs/geeklogbase/geeklog-1.7.2/plugins/staticpages/services.inc.php on line 686

Since I can't change php version of on server how can I fix?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/02
Posts: 13073
Location:Stuttgart, Germany
That's a bug :shock:

Since the piece of code it's complaining about won't be executed on PHP 4 anyway, simply open that file at the given line and remove the offending '&' sign.

Can you please file a bug report for this? Thanks.

bye, Dirk
 Quote

All times are EST. The time is now 03:06 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content