Support the ongoing development of Laravel.io →
Configuration Requests

I use firewall package (http://packalyst.com/packages/package/pragmarx/firewall) in my app. This is ok in my two dev machine with php 5.5.3. When I installed it to staging server with php 5.3.10, it doesn't work. My composer is the latest version. I got this error. Everything is working fine except this firewall. Symfony \ Component \ Debug \ Exception \ FatalErrorException Using $this when not in object context

Last updated 2 years ago.
0

Hey zawmyohtet,

That package is not compatible with PHP 5.3. I didn't find that exact issue but in other spots it uses the new shorthand array syntax which was added in PHP 5.4.

--edit--

Also, in the link below it's using $this inside of a closure which is probably generating the error you are seeing.

https://github.com/antonioribeiro/firewall/blob/master/src/Vendor/Laravel/ServiceProvider.php#L117

I opened an issue on Github with the package maintainer.

Last updated 2 years ago.
0

Just pushed changes to Firewall package removing all $this references from closures, to support PHP 5.3.x.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.