Jump to main content
University Computer Centre
Transition from PHP 5.4 to PHP 7.2

Transition from PHP 5.4 to PHP 7.2

On the central web servers, the PHP version was raised from 5.4 to 7.2 on September 11, 2018. Please check your websites and web applications on the test server www-test.tu-chemnitz.de, which runs PHP 7.2. There you can check the error log for your accesses.

News and changes for web authors

Discontinuation of the old MySQL interface

Functions like mysql_connect() or mysql_query() are no longer supported in PHP 7. There are two new interfaces to access MySQL databases. See Choosing an API for instructions. We recommend the use of PDO (PHP Data Objects). Please read our detailed article PHP 5 nach PHP 7: Umstellung von MySQL-Funktionen (PHP 5 to PHP 7: Migration of MySQL functions).

Removal of ereg_* functions

Functions like ereg_replace() must be replaced by the preg_ equivalents, here preg_replace(). AAttention, the syntax of the arguments differs, see Regular Expressions (Perl-Compatible).

Other functions to replace

  • split() must be replaced by explode() or preg_split().

Default character set is UTF-8

The PHP default_charset setting is UTF-8 with PHP 7. If you have PHP files that are in ISO-8859-1 or ISO-8859-15 character encoding and are not handled via TUCAL (no call to seite()), you need to change this setting, e. g. via a line in the .htaccess file:

php_value default_charset "ISO-8859-15"
In the long run, you should consider switching to UTF-8 character encoding.

or development and debugging: ook into the error_log of the server www-test.tu-chemnitz.de (for your own IP address)

Documentation