«Call to undefined function ctype_upper()»

mage2.pro
(Sam D) #1

Hi
I am seeing this error now while trying to open homepage of M2

Fatal error: Uncaught Error: Call to undefined function ctype_upper() in /app/vendor/mage2pro/core/registration.php:11 Stack trace: #0 /app/vendor/composer/autoload_real.php(71): require() #1 /app/vendor/composer/autoload_real.php(61): composerRequiree7061e592219e2211fb1770f3b2875c9('f0cb11b764d24bd...', '/app/vendor/com...') #2 /app/vendor/autoload.php(7): ComposerAutoloaderInite7061e592219e2211fb1770f3b2875c9::getLoader() #3 /app/app/autoload.php(21): include('/app/vendor/aut...') #4 /app/app/bootstrap.php(30): require_once('/app/app/autolo...') #5 /app/pub/index.php(13): require('/app/app/bootst...') #6 {main} thrown in /app/vendor/mage2pro/core/registration.php on line 11
0 Likes

Magento 2.0.x and 2.1.x both depend on the «ctype» PHP extension, but they do not document it
(Dmitry Fedyuk) #2

ctype_upper is a standard PHP function: http://php.net/manual/en/function.ctype-upper.php
The Ctype is a built-in PHP package:

Beginning with PHP 4.2.0 these functions are enabled by default. For older versions you have to configure and compile PHP with --enable-ctype . You can disable ctype support with --disable-ctype.

Is your PHP interpreter compiled with the key --disable-ctype?
You can check it with the console command:

php -i | grep ctype

0 Likes

(Sam D) #3

The command returns nothing. So I guess it isn’T enabled ? I am using Magento Cloud.

0 Likes

(Dmitry Fedyuk) #4

Yes, it looks like somebody has compiled your PHP interpreter with the explicit --disable-ctype key.
Address it to your hoster or system administrator.

0 Likes

(Sam D) #5

is there a work around in the meantime that I could use to replace this function?

0 Likes

(Dmitry Fedyuk) #6

Ctype is a standard package.
Magento 2 core modules use the ctype_* functions in many places, e.g.:

A workaround is to replace the problem PHP interpreter with a standard one.

0 Likes

(Dmitry Fedyuk) #7

Did you resolve the problem?

0 Likes

(Sam D) #8

Yes thank you.

0 Likes