Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) - cpanel

I uploaded laravel 5.4 in cpanel but I get this error.
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting
identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in
/home/lorestantv/MySite.com/public/index.php on line 50

Change PHP version 5.6 or newer.

Related

Migrating ZF2 to ZF3: Zend\Mvc\Router\Http\Segment was not found in the plugin manager

I'm migrating a ZF2 application to ZF3.
First I was getting the error:
Fatal error: Uncaught Zend\ModuleManager\Listener\Exception\RuntimeException: Could not find a valid ServiceManager for RoutePluginManager in /var/www/work/path/to/project/vendor/zendframework/zend-modulemanager/src/Listener/ServiceListener.php on line 202
Zend\ModuleManager\Listener\Exception\RuntimeException: Could not find a valid ServiceManager for RoutePluginManager in /var/www/work/path/to/project/vendor/zendframework/zend-modulemanager/src/Listener/ServiceListener.php on line 202
Adding of 'Zend\Router' to the modules array in the application.config.php solved the issue. But now I'm getting another error:
Fatal error: Uncaught Zend\ServiceManager\Exception\ServiceNotFoundException: A plugin by the name "Zend\Mvc\Router\Http\Segment" was not found in the plugin manager Zend\Router\RoutePluginManager in /var/www/work/path/to/project/vendor/zendframework/zend-servicemanager/src/AbstractPluginManager.php on line 131
Zend\ServiceManager\Exception\ServiceNotFoundException: A plugin by the name "Zend\Mvc\Router\Http\Segment" was not found in the plugin manager Zend\Router\RoutePluginManager in /var/www/work/path/to/project/vendor/zendframework/zend-servicemanager/src/AbstractPluginManager.php on line 131
What might cause this error and how to fix it?
Caused by Zend\Mvc\Router has been moved to Zend\Router, so just replace Zend\Mvc\Router\Http\Segment to Zend\Router\Http\Segment

ModSecurity - error parsing actions unknown action \\

I'm trying to implement OWASP CRS 3.0.0-rc1 on ModSecurity 2.9.1 (Apache\Ubuntu)
When starting Apache, I'm getting the following error.
AH00526: Syntax error on line 35 of /etc/apache2/conf/crs/rules/RESPONSE-50-DATA-LEAKAGES-PHP.conf:
Error parsing actions: Unknown action: \\
Action 'configtest' failed.
This is the snippet from the ruleset
RESPONSE-50-DATA-LEAKAGES-PHP.conf:
SecRule RESPONSE_BODY "#pmf php-errors.data" \
"msg:'PHP Information Leakage',\
id:'950180',\
phase:response,\
ver:'OWASP_CRS/3.0.0',\
rev:'3',\
maturity:'9',\
accuracy:'9',\
t:none,\
capture,\
ctl:auditLogParts=+E,\ THIS IS LINE 35
block,\
For some reason, if I simply move line 35 up one...
capture,ctl:auditLogParts=+E,\
It no longer squawks about this file... But I get another error
AH00526: Syntax error on line 31 of /etc/apache2/conf/crs/rules/RESPONSE-50-DATA-LEAKAGES.conf:
Error parsing actions: Unknown action: \\
RESPONSE-50-DATA-LEAKAGES.conf:
SecRule RESPONSE_BODY "(?:<(?:TITLE>Index of.*?<H|title>Index of.*?<h)1>Index of|>\[To Parent Directory\]<\/[Aa]><br>)" \
"phase:response,\
rev:'2',\
ver:'OWASP_CRS/3.0.0',\
maturity:'9',\
accuracy:'9',\
t:none,\ THIS IS LINE 31
capture,\
which again is solved by combining with the line above it.
accuracy:'9',t:none,\
The odd thing, is that it's NOT the same contents...
I'm just trying to get a handle on what is really causing this error. And would it be a bug in ModSecurity 2.9.1 or rather the RuleSet itself? Or something with how the multi line character is parsed?
It's a known apache bug; fixed in 2.4.11.
https://bz.apache.org/bugzilla/show_bug.cgi?id=55910

error while using sails.js sails-mssql adapter

I am trying to connect to a SQL Server database from within my sails.js app. I'm using sergeibelov/sails-mssql to connect to a remote Azure instance.
I've set up the database info in config/adapters.js.
When I try to connect using valid credentials, I get the following error:
error: Hook failed to load: orm (Error: Incorrect syntax near the keyword 'user'.)
error: Error encountered while loading Sails core!
error: Error: Incorrect syntax near the keyword 'user'.
at Request.userCallback (TestApp/node_modules/sails-mssql/node_modules/mssql/lib/tedious.js:352:23)
at Request.callback (TestApp/node_modules/sails-mssql/node_modules/mssql/node_modules/tedious/lib/request.js:24:27)
at Connection.STATE.SENT_CLIENT_REQUEST.events.message (TestApp/node_modules/sails-mssql/node_modules/mssql/node_modules/tedious/lib/connection.js:198:29)
at Connection.dispatchEvent (TestApp/node_modules/sails-mssql/node_modules/mssql/node_modules/tedious/lib/connection.js:465:59)
at Connection.c.dispatchEvent (TestApp/node_modules/sails-mssql/node_modules/mssql/lib/tedious.js:206:26)
at MessageIO. (TestApp/node_modules/sails-mssql/node_modules/mssql/node_modules/tedious/lib/connection.js:419:20)
at MessageIO.EventEmitter.emit (events.js:92:17)
at MessageIO.eventData (TestApp/node_modules/sails-mssql/node_modules/mssql/node_modules/tedious/lib/message-io.js:59:21)
at Socket. (TestApp/node_modules/sails-mssql/node_modules/mssql/node_modules/tedious/lib/message-io.js:3:59)
at Socket.EventEmitter.emit (events.js:95:17)
at Socket. (_stream_readable.js:746:14)
at Socket.EventEmitter.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:408:10)
at emitReadable (_stream_readable.js:404:5)
at readableAddChunk (_stream_readable.js:165:9)
at Socket.Readable.push (_stream_readable.js:127:10)
at TCP.onread (net.js:526:21)
When I change to an invalid user, I get a different error:
error: Hook failed to load: orm (Error: Login failed; one or more errorMessage events should have been emitted)
error: Error encountered while loading Sails core!
error: Error: Login failed; one or more errorMessage events should have been emitted
at TestApp/node_modules/sails-mssql/node_modules/mssql/lib/tedious.js:238:19
at TestApp/node_modules/sails-mssql/node_modules/mssql/node_modules/generic-pool/lib/generic-pool.js:271:11
at Connection.connect (TestApp/node_modules/sails-mssql/node_modules/mssql/lib/tedious.js:215:24)
at Connection.g (events.js:180:16)
at Connection.EventEmitter.emit (events.js:95:17)
at Connection.processLogin7Response (TestApp/node_modules/sails-mssql/node_modules/mssql/node_modules/tedious/lib/connection.js:592:12)
at Connection.STATE.SENT_LOGIN7_WITH_STANDARD_LOGIN.events.message (TestApp/node_modules/sails-mssql/node_modules/mssql/node_modules/tedious/lib/connection.js:153:23)
at Connection.dispatchEvent (TestApp/node_modules/sails-mssql/node_modules/mssql/node_modules/tedious/lib/connection.js:465:59)
at Connection.c.dispatchEvent (TestApp/node_modules/sails-mssql/node_modules/mssql/lib/tedious.js:206:26)
at MessageIO. (TestApp/node_modules/sails-mssql/node_modules/mssql/node_modules/tedious/lib/connection.js:419:20)
at MessageIO.EventEmitter.emit (events.js:92:17)
at MessageIO.eventData (TestApp/node_modules/sails-mssql/node_modules/mssql/node_modules/tedious/lib/message-io.js:59:21)
at Socket. (TestApp/node_modules/sails-mssql/node_modules/mssql/node_modules/tedious/lib/message-io.js:3:59)
at Socket.EventEmitter.emit (events.js:95:17)
at Socket. (_stream_readable.js:746:14)
at Socket.EventEmitter.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:408:10)
at emitReadable (_stream_readable.js:404:5)
at readableAddChunk (_stream_readable.js:165:9)
at Socket.Readable.push (_stream_readable.js:127:10)
at TCP.onread (net.js:526:21)
Given the system doesn't throw an error the "Incorrect syntax near the keyword 'user'" when I use an invalid user, I think the first error message is a red herring.
Any thoughts on how to fix this?
Solved it.
Turns out user didn't have anything to do with the user logging in to the database (the 'user' setting in config/adapters.js).
I had created a model and controller called user (sails generate user). After connecting to the database, sails was trying to add the 'createdAt' and 'updatedAt' fields to the user table. But the database user I was connecting with did not have write permissions, so it was throwing an error.
Once I created the correct columns in the database, everything worked fine.

Why am I getting several Warning: Invalid argument supplied for foreach() in errors after moving Joomla 2.5 site to new webhost?

I have a website built on Joomla 2.5.9 that I moved from my development server
to my client's hosting account on GoDaddy. All of the files have been uploaded,
the database created, the contents of the development server database has been
imported and the configuration.php file has been updated.
Here is the site on my development server:
http://digitaldemo.net/anova/
and on my client's GoDaddy account:
http://scientific-practices.com/demo/
Instead of the site coming up, all I get are the following errors:
Warning: Invalid argument supplied for foreach() in /home/content/27/10688727/html/booksite/demo/libraries/joomla/access/access.php on line 409
Warning: Invalid argument supplied for foreach() in /home/content/27/10688727/html/booksite/demo/libraries/joomla/plugin/helper.php on line 59
Warning: Invalid argument supplied for foreach() in /home/content/27/10688727/html/booksite/demo/libraries/joomla/plugin/helper.php on line 59
Warning: Invalid argument supplied for foreach() in /home/content/27/10688727/html/booksite/demo/libraries/joomla/application/menu.php on line 63
Warning: array_reverse() expects parameter 1 to be array, null given in /home/content/27/10688727/html/booksite/demo/includes/router.php on line 221
Warning: Invalid argument supplied for foreach() in /home/content/27/10688727/html/booksite/demo/includes/router.php on line 227
Warning: Invalid argument supplied for foreach() in /home/content/27/10688727/html/booksite/demo/includes/application.php on line 465
Fatal error: Call to a member function get() on a non-object in /home/content/27/10688727/html/booksite/demo/templates/beez_20/error.php on line 10
Any help would be appreciated.
Thanks!
Cynthia
i think this issue for php version / mysql version problem
please check.

missing ios 5 Headers giving theos errors

So yeah heres the error code when compiling from my ipad via theos
Making all for bundle iNotitweet...
Compiling iNotitweetController.m...
In file included from iNotitweetController.m:2:
/var/theos/include/Twitter/Twitter.h:7:36: error: _ABAddressBookAddRecord.h: No
such file or directory
In file included from /var/theos/include/Twitter/Twitter.h:9,
from iNotitweetController.m:2:
/var/theos/include/Twitter/NSCoding-Protocol.h:8: warning: duplicate declaration for protocol 'NSCoding'
In file included from iNotitweetController.m:2:
/var/theos/include/Twitter/Twitter.h:13: error: cannot find interface declaration
for '_ABAddressBookAddRecord', superclass of 'Twitter'
iNotitweetController.m: In function '-[iNotitweetController composeTweet]':
iNotitweetController.m:48: error: 'TWTweetComposeViewController' undeclared (first
use in this function)
iNotitweetController.m:48: error: (Each undeclared identifier is reported only once
iNotitweetController.m:48: error: for each function it appears in.)
iNotitweetController.m:48: error: 'twtComposer' undeclared (first use in this
function)
iNotitweetController.m:50: error: expected expression before '^' token
make[2]: *** [obj/iNotitweetController.m.o] Error 1
make[1]: *** [internal-bundle-all_] Error 2
make: *** [iNotitweet.all.bundle.variables] Error 2
im using rpetrich's headers and stole the twitter header from from the freemanrepo on github, could anybody please tell me what these errors mean and where i can find _ABAddressBookAddRecord.h im following this code http://pastebin.com/rArx47Bx and this tutorial http://tumblr.leonnears.com/post/17966636490/create-ncwidget-ios.
Those headers are compatibility headers for old versions of iPhoneOS (even before it was iOS), and I do not recommend the continued use of them - there is no real need to support versions below 4.3.3 anyways (or even 5.0.1), as almost everyone is on at least one of those two firmwares. For the most recent headers, either dump your own from the dyldcache (using kennytm's dyld_decache from here), or you can find the SpringBoard headers for iOS 5 here.