Giter Site home page Giter Site logo

Return value of Tuupola\\Middleware\\CorsMiddleware::origin() must be an instance of Tuupola\\Middleware\\void, none returned about slim-api-skeleton HOT 4 CLOSED

tuupola avatar tuupola commented on August 22, 2024
Return value of Tuupola\\Middleware\\CorsMiddleware::origin() must be an instance of Tuupola\\Middleware\\void, none returned

from slim-api-skeleton.

Comments (4)

tuupola avatar tuupola commented on August 22, 2024

What is the PHP version? PHP 7.1 is the minimal requirement for the CORS middleware.

from slim-api-skeleton.

controlnocontrol avatar controlnocontrol commented on August 22, 2024

from slim-api-skeleton.

tuupola avatar tuupola commented on August 22, 2024

Ok that is weird. Unit tests pass with PHP 7.2 and I am also using the middleware myself with PHP 7.2.

Have the files in vendor/ been edited manually? The method should look like following:

https://github.com/tuupola/cors-middleware/blob/master/src/CorsMiddleware.php#L159-L165

from slim-api-skeleton.

controlnocontrol avatar controlnocontrol commented on August 22, 2024

I figured the issue out. My host's cPanel was trying to add some code to the root's .htaccess file to dictate the PHP version. There was some conflict but now all seems fine! The weird that was that the server was still running PHP7.2 when dumping phpinfo. BTW I'm running Craft 3 CMS and SLIM on the same environment and everything seems to be working okay!

And no I haven't edited the vendor files manually. That wouldn't be a very wise thing to do. :)

from slim-api-skeleton.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.