Creation with PHP files of a certain size with a random content

The file is not suitable to be accessed via a web browser. It must be started with the command line: “php filename.php” to give the script practically all the time and allow sufficient resources for its execution. In Debian install the tool with: # apt-get install php5-cli. In the directory of the file start it with # php ./filename.php.

Continue reading “Creation with PHP files of a certain size with a random content”

PHP: Maximum execution time exceeded

If you write a PHP script that takes a long time to run, there is the following error message:

Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/xy.php on line xy

For this you have in php.ini (Debian: /etc/php5/apache2/php.ini) set the following values to prevent the error:

max_execution_time = 0;
max_input_time = 0

Restart the server with /etc/init.d/apache2 restart.

In a production environment with public access this configuration is HIGHLY not recommended.