简体   繁体   中英

500 internal server error in zend framework

I am learning zend framework, i have setup all requirement for it as per tutorial given for zend framework, but still i got error this error :

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

How can I resolve it?

Using Zend Application you may see more information about the errors putting those lines in application.ini :

phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1

500 Errors are mostly caught exeptions. You may debug the problem looking at the variables in ErrorController.php .

Also, the most common Apache issues:

  • mod_rewrite module not enabled in Apache
  • required RewriteBase / rule in .htaccess (on shared hostings)
  • missing AllowOverride All in virtual host configuration

Like the message suggests, you need to check the server error log to see what the problem actually is. If you are using Apache, it's the Apache error log that you need to check. On Linux systems this will be at somewhere like /var/log/apache2/error.log .

If you're using NGINX:

Change:

 location / {
    try_files $uri $uri/ /index.html;
 }

To:

 location / {
    try_files $uri $uri/ /index.php?q=$uri&$args;
 }

You don't have mod_rewrite loaded.

Find your httpd.conf file and locate the line:

#LoadModule rewrite_module modules/mod_rewrite.so

Remove the # sign from the beginning of the line to uncomment and activate it.

Next, add a new section to httpd.conf that looks like this:

<Directory "C:/wamp/www/CRUD_ZEND/public">
    Options FollowSymLinks
    AllowOverride All
</Directory>


 The `AllowOverride` directive is important. By default, `.htaccess` files are not processed unless allowed. This line allows `.htaccess` files in that named directory.

After making those changes, restart Apache and then try loading your ZF2 page again.
try this link

Try this link, it will help you. You will get a working solution,definitely.

You need two things:

  1. SSH/SFTP access
  2. Knowledge of where your Apache config folder is located

Log files for Apache are usually stored in /etc/httpd/logs - but it depends on your Linux setup.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM