Common conflicting issues and error handling

Status
Not open for further replies.

Rodolfo

Chevereto Developer
Chevereto Staff
Joined
Oct 7, 2008
Messages
16,471
Points
237
Location
Chevereto HQ
Website
rodolfoberrios.com
Parse error: syntax error, unexpected '[', expecting ')' in ...

This error is displayed when you run PHP < 5.5.0. Chevereto requires at least PHP 5.5.0 and works best with PHP 7.2.

Chevereto error: Internal Server Error

When you get this is because the system is hiding the actual stack trace (full error message). Jump to "Error handling and debug" if you are getting this.

Common server issues

This is a list of known server errors and things that could cause errors:
  • Invalid PHP version (lower than 5.5.0)
  • Missing libraries (Like PDO, cURL, GD)
  • Wrong mod_rewrite functionality (you can test this going to /page/contact)
  • Wrong MySQL server credentials (wrong user, password and or database name)
  • Wrong PHP /tmp folder (open base dir restrictions, permissions issue)
  • Wrong public permissions (Apache can't create/modify files, permission issue)
  • Missing files in the installation (always upload all that you see)
Upload issues

There are few things in the checklist before going panic:
  1. Permissions. When you run Chevereto or any PHP script it does over a web server (Apache, Nginx). If the Apache (web server) user doesn't have writing permission in the folders used by the software, the system won't be able to work properly
    • Make sure that the user that runs the web server has permission over the folder used by the software
    • Make sure that the folder is owned by the user who runs Apache or the web server
    • Don't use chmod 777 (not recommended, unsafe)
    • Check this guide for additional help
  2. php.ini limits. The PHP configuration file (php.ini) holds the default and max. values that determine how limited fileupload will be. If you want to allow bigger images to be uploaded, you need to to increase execution_time, max_post_size, and max_upload_size in this configuration file. The software won't overpass php.ini settings.
  3. Network issues. The file transfer between a peer and your server depends entirely on network. If the network is slow (local ISP issues, slow internet connection, bad data center network, localized issues, etc.) the uploads won't work as expected.
Error handling and debug

Chevereto comes with an error tracer that catches exceptions and displays it nicely and safer (it doesn't show full paths). You can control debug by configuring debug_level.

The system handles errors in a stack trace which won't show any sensitive information and helps a lot to understand what is happening. Don't panic and read/share what your trace says. When you get a trace is because Chevereto detected the error and stopped the execution. If you get Chevereto error: Internal Server Error message is because Chevereto hides the full error message by default. If your debug_level is configured to log errors and you don't get anything then use debug_level = 3 which is the most intensive debug level and it will safely display the error directly in your screen because it will be printed on execution.

If you get a parse error the only possible causes are:
  • You are not running PHP >= 5.5.0
    The common output for this error is "PHP Parse error: syntax error, unexpected '['" and is triggered because Chevereto won't work with PHP < 5.4.0 versions. You will need to upgrade your server to at least PHP version 5.4.0.
  • You did a bad editing and you broke the code due to wrong code syntax.
  • You aren't using a code editor (always use UTF-8 without BOM) when editing .php files.
When you get a white screen these are the common cause:
  • Chevereto stopped execution due to a fatal error
    In this case, you will only see a white screen with no data. Most likely is an error related to a missing library or things that you will need to fix in your server. In some cases, this is triggered when you don't upload some files to the server (script files).
  • Your php.ini settings are not allowing to show errors
    php.ini file settings could be restricting errors to be shown (display_errors = 0 mutes the output, log_errors = 0 disables error log).
In a production environment is normal to do not display the errors in execution, instead, the errors are logged in the server's error_log file which will have all the needed information of error that just happened. If you don't have an error log file you should configure your server to store those logs.
 
Reactions: DragoN
Status
Not open for further replies.