owncloud-archive / news

:newspaper: News app for ownCloud
GNU Affero General Public License v3.0
290 stars 106 forks source link

PHP Parse error: syntax error // (T_CLASS) // (T_STRING) // (T_VARIABLE) #975

Closed GIT-STATA closed 8 years ago

GIT-STATA commented 8 years ago

What problem did you encounter?

(ownCloud 9.0.1 / PHP Version 5.6.5 )

I do have to deactivate the news app every time I check for updates via the command

sudo -u apache php occ upgrade

furthermore

sudo -u apache php -f /var/www/html/owncloud/cron.php

is creating a lot of errors...

I really face those problems only when news is installed and activated! Any ideas are very welcome. Thanks to all of you!!!

Did you find any solution for fixing this problem?

See #844 - NO

Steps to Reproduce

  1. ownCloud 9.0.1
  2. I used the 'app store version'... news.tar.gz
  3. I use PHP 5.6.5 by Software Collections (www.softwarecollections.org).

Dependencies should be all fine. I checked e.g.

php -i | grep libxml

libxml Version => 2.9.1 php-curl (/etc/opt/rh/rh-php56/php.d/20-simplexml.ini) iconv ( iconv library version => 2.17 ) SimpleXML (/etc/opt/rh/rh-php56/php.d/20-simplexml.ini)

System Information

PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /var/www/html/owncloud/apps/news/appinfo/application.php on line 56

and

{"reqId":"VxDvvLc5mjKlvleqvmBORAAAAAU","remoteAddr":"::1","app":"PHP","message":"rmdir(\/tmp\/oc_tmp_RzVlxm-folder\/news\/vendor\/bin): Directory not empty at \/var\/www\/html\/owncloud\/lib\/private\/helper.php#225","level":3,"time":"2016-04-15T13:42:25+00:00","method":"POST","url":"\/owncloud\/index.php\/settings\/ajax\/enableapp.php","user":"admin"} {"reqId":"VxDvvLc5mjKlvleqvmBORAAAAAU","remoteAddr":"::1","app":"PHP","message":"rmdir(\/tmp\/oc_tmp_RzVlxm-folder\/news\/vendor): Directory not empty at \/var\/www\/html\/owncloud\/lib\/private\/helper.php#225","level":3,"time":"2016-04-15T13:42:25+00:00","method":"POST","url":"\/owncloud\/index.php\/settings\/ajax\/enableapp.php","user":"admin"} {"reqId":"VxDvvLc5mjKlvleqvmBORAAAAAU","remoteAddr":"::1","app":"PHP","message":"rmdir(\/tmp\/oc_tmp_RzVlxm-folder\/\/news): Directory not empty at \/var\/www\/html\/owncloud\/lib\/private\/helper.php#231","level":3,"time":"2016-04-15T13:42:25+00:00","method":"POST","url":"\/owncloud\/index.php\/settings\/ajax\/enableapp.php","user":"admin"} {"reqId":"VxDvvLc5mjKlvleqvmBORAAAAAU","remoteAddr":"::1","app":"PHP","message":"unlink(): No such file or directory at \/var\/www\/html\/owncloud\/lib\/private\/helper.php#227","level":3,"time":"2016-04-15T13:42:25+00:00","method":"POST","url":"\/owncloud\/index.php\/settings\/ajax\/enableapp.php","user":"admin"} {"reqId":"VxDvvLc5mjKlvleqvmBORAAAAAU","remoteAddr":"::1","app":"PHP","message":"rmdir(\/tmp\/oc_tmp_RzVlxm-folder\/news\/vendor\/bin): Directory not empty at \/var\/www\/html\/owncloud\/lib\/private\/helper.php#225","level":3,"time":"2016-04-15T13:42:25+00:00","method":"POST","url":"\/owncloud\/index.php\/settings\/ajax\/enableapp.php","user":"admin"} {"reqId":"VxDvvLc5mjKlvleqvmBORAAAAAU","remoteAddr":"::1","app":"PHP","message":"rmdir(\/tmp\/oc_tmp_RzVlxm-folder\/news\/vendor): Directory not empty at \/var\/www\/html\/owncloud\/lib\/private\/helper.php#225","level":3,"time":"2016-04-15T13:42:25+00:00","method":"POST","url":"\/owncloud\/index.php\/settings\/ajax\/enableapp.php","user":"admin"} {"reqId":"VxDvvLc5mjKlvleqvmBORAAAAAU","remoteAddr":"::1","app":"PHP","message":"rmdir(\/tmp\/oc_tmp_RzVlxm-folder\/news): Directory not empty at \/var\/www\/html\/owncloud\/lib\/private\/helper.php#225","level":3,"time":"2016-04-15T13:42:25+00:00","method":"POST","url":"\/owncloud\/index.php\/settings\/ajax\/enableapp.php","user":"admin"} {"reqId":"VxDvvLc5mjKlvleqvmBORAAAAAU","remoteAddr":"::1","app":"PHP","message":"rmdir(\/tmp\/oc_tmp_RzVlxm-folder): Directory not empty at \/var\/www\/html\/owncloud\/lib\/private\/helper.php#231","level":3,"time":"2016-04-15T13:42:25+00:00","method":"POST","url":"\/owncloud\/index.php\/settings\/ajax\/enableapp.php","user":"admin"} {"reqId":"62\/tTBWgkDFpCC30gnPl","remoteAddr":"","app":"PHP","message":"syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' at \/var\/www\/html\/owncloud\/apps\/news\/appinfo\/application.php#56","level":3,"time":"2016-04-15T13:43:16+00:00","method":"--","url":"--","user":"--"} {"reqId":"To360MZbMyJwKJo1KFzK","remoteAddr":"","app":"PHP","message":"syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' at \/var\/www\/html\/owncloud\/apps\/news\/appinfo\/application.php#56","level":3,"time":"2016-04-15T13:43:35+00:00","method":"--","url":"--","user":"--"} {"reqId":"90120d6OH0x+5383\/h4I","remoteAddr":"","app":"PHP","message":"syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' at \/var\/www\/html\/owncloud\/apps\/news\/appinfo\/application.php#56","level":3,"time":"2016-04-15T13:43:41+00:00","method":"--","url":"--","user":"--"} {"reqId":"ai0s76xi+0QWwsSTf82E","remoteAddr":"","app":"PHP","message":"syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' at \/var\/www\/html\/owncloud\/apps\/news\/appinfo\/application.php#56","level":3,"time":"2016-04-15T13:45:01+00:00","method":"--","url":"--","user":"--"} {"reqId":"RctNS9eG0jYQOcN2tpqo","remoteAddr":"","app":"PHP","message":"syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' at \/var\/www\/html\/owncloud\/apps\/news\/appinfo\/application.php#56","level":3,"time":"2016-04-15T13:46:27+00:00","method":"--","url":"--","user":"--"} {"reqId":"DgLHPf3E8UmQX4au3rsq","remoteAddr":"","app":"PHP","message":"syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' at \/var\/www\/html\/owncloud\/apps\/news\/appinfo\/application.php#56","level":3,"time":"2016-04-15T13:46:31+00:00","method":"--","url":"--","user":"--"}

BernhardPosselt commented 8 years ago

After taking a look it looks like you are using a PHP version prior to 5.5, can you make absolutely sure that you are using 5.6?

BernhardPosselt commented 8 years ago

as in put this into a php file and view it in your browser:

phpinfo();
BernhardPosselt commented 8 years ago

Closing because of inactivity

GIT-STATA commented 8 years ago

Hi, I am very sorry for coming back to you so late! I had a lot stuff do do on the weekend!

So, when I view the phpinfo in my Browser (call phpinfo.php) everything is totally fine!

The bash needs to allow the user apache to use php 5.6 (because I am using PHP fromSoftware Collections (www.softwarecollections.org).

sudo -u apache scl enable rh-php56 bash

or better

sudo -u apache crontab -e /15 * * * \ /opt/rh/rh-php56/root/usr/bin/php -f /var/www/html/owncloud/cron.php

To check for updates

sudo -u apache /opt/rh/rh-php56/root/usr/bin/php occ upgrade

Then everything is totally fine!!!

Thanks so much!!!

BernhardPosselt commented 8 years ago

:)