The execution in the local Windows environment is normal, and a fatal error occurs on the Linux Server: Fatalerror: Calltoundefinedfunctioncom_create_guid (). The reason is that the PHP version of the server is high (5.4) and no built-in support for the com_create_guid () function, see the PHP official website installation instructions (php. netmanualencom. insta
The execution in the local Windows environment is normal, and a Fatal error occurs on the Linux Server: Fatal error: Call to undefined function com_create_guid () because the PHP version on the server is higher (5.4 ), no built-in support for the com_create_guid () function, see the PHP official website installation instructions (http://php.net/manual/en/com.insta
The local Windows environment runs normally and a fatal error occurs on the Linux Server:
Fatal error: Call to undefined function com_create_guid ()
The reason is that the PHP version of the server is relatively high (5.4) and does not have built-in support for the com_create_guid () function,
See PHP official website installation instructions (http://php.net/manual/en/com.installation.php ):
"From PHP 5.4.5, COM and DOTNET is no longer built into the php core. You have to add COM support in php.ini"
Therefore, you can either add the com Extension in php. ini or modify the Implementation of The GUID function to be compatible with various PHP versions, as shown below:
function getGUID(){ if (function_exists('com_create_guid')){ return com_create_guid(); }else{ mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up. $charid = strtoupper(md5(uniqid(rand(), true))); $hyphen = chr(45);// "-" $uuid = chr(123)// "{" .substr($charid, 0, 8).$hyphen .substr($charid, 8, 4).$hyphen .substr($charid,12, 4).$hyphen .substr($charid,16, 4).$hyphen .substr($charid,20,12) .chr(125);// "}" return $uuid; }}
Reference link:
Http://php.net/manual/en/function.com-create-guid.php
By iefreer