Home  >  Article  >  Backend Development  >  I created a folder in the yii2 framework. There is no problem running it locally, but when I pull up the server, a server 500 error occurs.

I created a folder in the yii2 framework. There is no problem running it locally, but when I pull up the server, a server 500 error occurs.

WBOY
WBOYOriginal
2016-08-08 09:06:43930browse

I created a folder in the yii2 framework. There is no problem running it locally, but when I pull up the server, a server 500 error occurs.

It will report an error in the place I marked, but this file comes with the system, why is it reporting an error?

Reply content:

I created a folder in the yii2 framework. There is no problem running it locally, but when I pull up the server, a server 500 error occurs.

It will report an error in the place I marked, but this file comes with the system, why is it reporting an error?

You can check whether the permissions of your server directory allow Apache to read and write

500 means a code error. Type the error message

I created a folder in the yii2 framework. There is no problem running it locally, but when I pull up the server, a server 500 error occurs.I created a folder in the yii2 framework. There is no problem running it locally, but when I pull up the server, a server 500 error occurs.

Now the last sentence will report an error

Pay attention to the PHP version of your server. Some versions of PHP do not support this writing method:
`
(new BigClassName)->func();
`
Please change it to the following writing method:
`
$xx = new BigClassName;
$xx->func();
`

Also, you can check the server error log, it will be most helpful.

Also, if the machine is in a Windows environment, please note that the case of the file name must be consistent. Linux is case-sensitive.

p.s. It’s so hard to code on mobile

Thank you for the invitation. Server 500 is a program error. I suggest you do breakpoint debugging. For specific problems, it is better to find the cause based on breakpoints

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn