OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



2.4.2 parse error during installation

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

2.4.2 parse error during installation

Postby noviceuser » Wed Jul 31, 2013 4:25 am

I made the first steps to install ( copied files, set file permissions etc.) on the Linux SLES / Apache server of my department and before the first screen i got this error:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/bibdis/public_html/techreport/cache/t_compile/%%7D^7DC^7DC17B21%%install.tpl.php on line 3

I had before a working installation ( 2.3.7) on the same server and the sysadmin tlold me no change was made to the configuration.
How can i solve or investigate this problem?

thanks in advance

PHP Settings
PHP Version => 5.2.14

PHP API => 20041225
PHP Extension => 20060613
Zend Extension => 220060519
Debug Build => no
Thread Safety => disabled
Zend Memory Manager => enabled
IPv6 Support => enabled
Registered PHP Streams => compress.bzip2, php, file, data, http, ftp, https, ftps, zip, compress.zlib
Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
Registered Stream Filters => bzip2.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, convert.iconv.*, zlib.*


This server is protected with the Suhosin Patch 0.9.7
Copyright (c) 2006 Hardened-PHP Project


Directive => Local Value => Master Value
allow_call_time_pass_reference => Off => Off
allow_url_fopen => On => On
allow_url_include => Off => Off
always_populate_raw_post_data => Off => Off
arg_separator.input => & => &
arg_separator.output => & => &
asp_tags => Off => Off
auto_append_file => no value => no value
auto_globals_jit => On => On
auto_prepend_file => no value => no value
browscap => no value => no value
default_charset => no value => no value
default_mimetype => text/html => text/html
define_syslog_variables => Off => Off
disable_classes => no value => no value
disable_functions => no value => no value
display_errors => Off => Off
display_startup_errors => Off => Off
doc_root => no value => no value
docref_ext => no value => no value
docref_root => no value => no value
enable_dl => Off => Off
error_append_string => no value => no value
error_log => no value => no value
error_prepend_string => no value => no value
error_reporting => 6143 => 6143
expose_php => On => On
extension_dir => /usr/lib/php5/extensions => /usr/lib/php5/extensions
file_uploads => On => On
highlight.bg => <font style="color: #FFFFFF">#FFFFFF</font> => <font style="color: #FFFFFF">#FFFFFF</font>
highlight.comment => <font style="color: #FF8000">#FF8000</font> => <font style="color: #FF8000">#FF8000</font>
highlight.default => <font style="color: #0000BB">#0000BB</font> => <font style="color: #0000BB">#0000BB</font>
highlight.html => <font style="color: #000000">#000000</font> => <font style="color: #000000">#000000</font>
highlight.keyword => <font style="color: #007700">#007700</font> => <font style="color: #007700">#007700</font>
highlight.string => <font style="color: #DD0000">#DD0000</font> => <font style="color: #DD0000">#DD0000</font>
html_errors => Off => Off
ignore_repeated_errors => Off => Off
ignore_repeated_source => Off => Off
ignore_user_abort => Off => Off
implicit_flush => On => On
include_path => .:/usr/share/php5:/usr/share/php5/PEAR => .:/usr/share/php5:/usr/share/php5/PEAR
log_errors => On => On
log_errors_max_len => 1024 => 1024
magic_quotes_gpc => Off => Off
magic_quotes_runtime => Off => Off
magic_quotes_sybase => Off => Off
mail.force_extra_parameters => no value => no value
max_execution_time => 0 => 0
max_file_uploads => 20 => 20
max_input_nesting_level => 64 => 64
max_input_time => -1 => -1
memory_limit => 128M => 128M
open_basedir => no value => no value
output_buffering => 0 => 0
output_handler => no value => no value
post_max_size => 8M => 8M
precision => 14 => 14
realpath_cache_size => 16K => 16K
realpath_cache_ttl => 120 => 120
register_argc_argv => On => On
register_globals => Off => Off
register_long_arrays => Off => Off
report_memleaks => On => On
report_zend_debug => Off => Off
safe_mode => Off => Off
safe_mode_exec_dir => no value => no value
safe_mode_gid => Off => Off
safe_mode_include_dir => no value => no value
sendmail_from => no value => no value
sendmail_path => /usr/sbin/sendmail -t -i => /usr/sbin/sendmail -t -i
serialize_precision => 100 => 100
short_open_tag => Off => Off
SMTP => localhost => localhost
smtp_port => 25 => 25
sql.safe_mode => Off => Off
suhosin.log.phpscript => 0 => 0
suhosin.log.phpscript.is_safe => Off => Off
suhosin.log.phpscript.name => no value => no value
suhosin.log.sapi => no value => no value
suhosin.log.script => no value => no value
suhosin.log.script.name => no value => no value
suhosin.log.syslog => no value => no value
suhosin.log.syslog.facility => no value => no value
suhosin.log.syslog.priority => no value => no value
suhosin.log.use-x-forwarded-for => Off => Off
track_errors => Off => Off
unserialize_callback_func => no value => no value
upload_max_filesize => 2M => 2M
upload_tmp_dir => /tmp => /tmp
user_dir => no value => no value
variables_order => GPCS => GPCS
xmlrpc_error_number => 0 => 0
xmlrpc_errors => Off => Off
y2k_compliance => On => On
zend.ze1_compatibility_mode => Off => Off
noviceuser
 
Posts: 5
Joined: Wed Jul 31, 2013 4:01 am

Re: 2.4.2 parse error during installation

Postby asmecher » Wed Jul 31, 2013 8:28 am

Hi noviceuser,

Can you paste line 3 of /home/bibdis/public_html/techreport/cache/t_compile/%%7D^7DC^7DC17B21%%install.tpl.php into this thread?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8346
Joined: Wed Aug 10, 2005 12:56 pm

Re: 2.4.2 parse error during installation

Postby noviceuser » Wed Jul 31, 2013 11:34 am

This what appears on screen

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/bibdis/public_html/techreport/cache/t_compile/%%7D^7DC^7DC17B21%%install.tpl.php on line 3

single line, nothing else
noviceuser
 
Posts: 5
Joined: Wed Jul 31, 2013 4:01 am

Re: 2.4.2 parse error during installation

Postby asmecher » Wed Jul 31, 2013 11:42 am

Hi noviceuser,

What I'm looking for is the file's contents from the server, not the error message.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8346
Joined: Wed Aug 10, 2005 12:56 pm

Re: 2.4.2 parse error during installation

Postby noviceuser » Wed Jul 31, 2013 11:51 am

Sorry, i misunderstood, this is the file content:

<?php /* Smarty version 2.6.26, created on 2013-07-30 13:20:44
compiled from install/install.tpl */ ?>
<?php echo '; ?><?php $this->assign('pageTitle', "installer.ojsInstallation"); ?><?php echo '; ?><?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "core:install/install.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
?><?php echo '; ?>
noviceuser
 
Posts: 5
Joined: Wed Jul 31, 2013 4:01 am

Re: 2.4.2 parse error during installation

Postby asmecher » Wed Jul 31, 2013 4:04 pm

Hi noviceuser,

Your installation contains broken Smarty template cache code; see e.g. the code snippet:
Code: Select all
<?php echo '; ?>
This is invalid PHP.

Either Smarty is compiling it wrong or something else is modifying it. Smarty doesn't normally behave this way. I wonder if you aren't dealing with a malware infestation, possibly brought on by unsafe (i.e. 777) file permissions in cache/ or cache/t_compile? The best way to determine if that's the case is to a) double-check your file permissions in cache/ and cache/t_compile, and b) use "diff" to compare your installation's code against the stock package to see if anything has been modified.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8346
Joined: Wed Aug 10, 2005 12:56 pm

Re: 2.4.2 parse error during installation

Postby noviceuser » Mon Aug 05, 2013 3:08 am

Current settings for cache directories are

user www(group of webserver) others 775

the output of DIFF:
ojs-2.4.2 the original package
techreport the actual directory installed on the webserver ( copied locally)

Only in /Users/mac/Downloads/ojs-2.4.2/cache: .DS_Store
Only in /Users/mac/Downloads/ojs-2.4.2/plugins/importexport/duracloud/lib/DuraCloud-PHP: .git
Only in /Users/mac/Downloads/ojs-2.4.2/templates: .DS_Store
Only in /Users/mac/Downloads/ojs-2.4.2: .DS_Store
Only in /Users/mac/Downloads/techreport/cache/t_compile: %%7D^7DC^7DC17B21%%install.tpl.php
Only in /Users/mac/Downloads/techreport/cache: fc-locale-03b174b61510807426c2a2c128f6a86a.php
Only in /Users/mac/Downloads/techreport/cache: fc-locale-1cfde42be2b25bdac1c9a16538de37a8.php
Only in /Users/mac/Downloads/techreport/cache: fc-locale-39ad57a0a799a092b476f7b3d029e60d.php
Only in /Users/mac/Downloads/techreport/cache: fc-locale-8c15ce7dfec31e437114d80f1f936272.php
Only in /Users/mac/Downloads/techreport/cache: fc-locale-list.php

hope it can help.
noviceuser
 
Posts: 5
Joined: Wed Jul 31, 2013 4:01 am

Re: 2.4.2 parse error during installation

Postby asmecher » Fri Aug 09, 2013 4:32 pm

Hi noviceuser,

Does the snippet of PHP I posted appear verbatim in the compiled templates?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8346
Joined: Wed Aug 10, 2005 12:56 pm

Re: 2.4.2 parse error during installation

Postby jainshailu » Mon Aug 26, 2013 9:01 pm

Could you finally resolve this problem? If yes, what steps did you follow?
We are also facing exact same problem & could not solve it since couple of days.

In our case permission is 755. Yes, we did have a hacker attack on our site & then it was resolved. Not sure if that modified something.

Thanks,
Innovare team
jainshailu
 
Posts: 6
Joined: Mon Aug 26, 2013 7:55 pm

Re: 2.4.2 parse error during installation

Postby asmecher » Tue Aug 27, 2013 8:45 am

Hi jainshailu,

It's likely that the hacking modified something. Try using the diff tool as recommended above to identify modifications; be aware that you can no longer trust anything that was modifiable by the attacker. Note that the permission numbers themselves are not enough to ensure security; the server SAPI, user, and group also matter.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8346
Joined: Wed Aug 10, 2005 12:56 pm

Re: 2.4.2 parse error during installation

Postby noviceuser » Wed Sep 04, 2013 8:24 am

Sorry for not responding but i came back from holyday today. The DIFF tool showed just one file modified and that one is in the plugins directory. The code snippet is into the template. Note: i tryed to delete the template and the new file created contains the snippet.

current file content:

Code: Select all
<?php /* Smarty version 2.6.26, created on 2013-08-07 13:04:06
         compiled from install/install.tpl */ ?>
<?php echo '; ?><?php $this->assign('pageTitle', "installer.ojsInstallation"); ?><?php echo '; ?><?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "core:install/install.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?><?php echo '; ?>


I spoke with the sever administrator but she told no suspicious activity was detected in the relevant time period.
noviceuser
 
Posts: 5
Joined: Wed Jul 31, 2013 4:01 am

Re: 2.4.2 parse error during installation

Postby asmecher » Wed Sep 04, 2013 8:42 am

Hi noviceuser,

Either Smarty is compiling templates incorrectly (which I suspect is the case here) or something else is modifying the cached files in a way that breaks them (less likely). I've never seen this behavior before and it's in Smarty rather than our code so it's tough for me to debug. I suspect some kind of platform quirk on your system. If you're able, try upgrading your PHP to a newer release; otherwise I'm afraid you're going to have to dive into Smarty's code (particularly Smarty_Compiler.class.php, in the _compile_file function) to find out why it's dropping malformed tags into your cache.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8346
Joined: Wed Aug 10, 2005 12:56 pm

Re: 2.4.2 parse error during installation

Postby hamsavijay » Sun Sep 15, 2013 4:42 am

Hi Novice User,
Did you manage to fix this installation error relating to T_String. Our hosting provider has done some changes and it did not help OJS perform well.

To resolve it, we've taken out another directory within same hosted server and done a clean install for OJS 2.4.2 and ended up with this error. I've enquired the hosting provider and they have mentioned that they do have another Linux server which can support php 5.4. as our current server was php 5.3.x

Please share how did you make it working. Thanks, Priya
hamsavijay
 
Posts: 18
Joined: Fri Jul 03, 2009 3:14 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Google [Bot] and 4 guests