Are PHP case-sensitive functions if not ...?

I use many functions in my PHP codes like these; UID(), user_getProfileImage() ... etc. I write all my projects on Windows and work well. This is normal, but when I put my project on my server, it gave an error like this:

Fatal error: Call to undefined function UID() in /var/www/vhosts/...

What? Is it undefined ?!

I check all my project files and FTP uploads all the files to the server again, again ... And the same error.

But when I change the name UID()to UID()(both in lib.php and other places where it is used), it works well.

So what's the problem? What is wrong with this server?

Local PHP vers: 5.3.10

PHP server info: http: // ... deleted

Note. I encode all PHP files in "UTF-8 without specification" (as always) using Notepad ++, and it is interesting that another project works well, even uses the same functions and runs on the same server.

Thank.

/ ################################# /

UPDATE (and solution);

  • Do not use the symbol β€œI” (metropolitan β€œi”) in any function name or
  • Just use setlocale like this; setlocale(LC_TIME, "tr_TR.UTF-8")// I only need to set the locale time and use this
  • If you need LC_ALL, be sure to install back LC_CTYPEin en_US, i.e.:

    setlocale(LC_ALL, "tr_TR.UTF-8"); setlocale(LC_CTYPE, "en_US");

+3
source share
4 answers

" I", , PHP (tr_TR, tr_TR.utf8...). "i" .

. https://bugs.php.net/18556 - " " tr_TR " "


:

  • (, , "i" ); .
  • , () .

, , - .

+3

Windows ( , - LAMP), ?

, Apache Linux, , , , , "" , ( , , "Lib.php", "lib.php" , "lib.php" , Linux (, ) "Lib.php" " , .

0

Linux , , UID() . , require_once, include, include_once .

0

Its actually a known bug, but still not fixed since 2002! See # 18556 .

In short, PHP uses an internal function tolower()that is localized, but in Turkish there are some specific rules for i (unotted Δ± is lowercase I and dashed Δ° is uppercase i). Therefore, if you have a class name of the method name with the top self (newInstanceArgs, Image, etc.), you have suffered.

The only workaround at the moment seems to be setting LC_CTYPEfor some working locale, for example.

setlocale(LC_ALL, 'tr_TR');
setlocale(LC_CTYPE, 'en_US');
0
source

All Articles