menu
small_header_webhosting.svg

netcup wiki

Webhosting

Usage of PHP in the Shell

Learn how to use PHP in a shell.

In our web hosting tariffs, the use of PHP is also possible in the shell if you are connected to the tariff via SSH.

You can find the PHP versions of netcup at:

PHP 5.6: /usr/local/php56/bin/php

PHP 7.0: /usr/local/php70/bin/php

PHP 7.1: /usr/local/php71/bin/php

PHP 7.2: /usr/local/php72/bin/php

PHP 7.3: /usr/local/php73/bin/php

PHP 7.4: /usr/local/php74/bin/php

PHP 8.0: /usr/local/php80/bin/php

PHP 8.1: /usr/local/php81/bin/php

PHP 8.2: /usr/local/php82/bin/php

If you only execute php in the shell, i.e. without a preceding path, the version configured in the file /conf/phpversion on your web space will be executed. You can change this default version by modifying this file. For more information on the correct procedure, see the file /conf-options/phpversion.readme. Please especially note that it will take some time for the changed setting to take effect.

Please note that the PHP versions in the shell may use a lower memory limit than when accessing your application with a browser. It is possible to increase the memory limit for PHP applications in the shell. To do this, pass the limit as an option:

php -d memory_limit=512M /path/to/your/script.php

Last update: 28/09/2023