Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return value of Tuupola\\Middleware\\CorsMiddleware::origin() must be an instance of Tuupola\\Middleware\\void, none returned #42

Closed
controlnocontrol opened this issue Jun 13, 2018 · 4 comments

Comments

@controlnocontrol
Copy link

controlnocontrol commented Jun 13, 2018

Hi there,

I'm trying to set up a basic test environment with on my hosting server. Everything was working fine but I'm suddenly getting a 500 error as indicated in the subject. Do you know what this is?

Thanks!

EDIT: Also, note that this is the second project I'm installing with the host. The first one had no issues at all.

@tuupola
Copy link
Owner

tuupola commented Jun 13, 2018

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

@controlnocontrol
Copy link
Author

controlnocontrol commented Jun 13, 2018 via email

@tuupola
Copy link
Owner

tuupola commented Jun 13, 2018

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

@controlnocontrol
Copy link
Author

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants