I am eager to ask for a question about the PHP namespace. I haven't eaten yet at PM. please help me !! Hello everyone, I have used the websocket function in the program. there is no error in local debugging of the program, but an error is reported when I transfer it to the service. I found it online and said it was a PHP version of s. yanghao. orgprogramviewdetail. php? I140457 the PHP version on my machine is 5.4, and the server is 5.2. may I ask P for an emergency question about the PHP namespace? I haven't eaten yet at PM. please help me !!
Hello everyone, I used the websocket function in the program, the local program debugging does not report an error, but the transfer to the service will report an error, found on the Internet, said PHP version of a http://s.yanghao.org/program/viewdetail.php? I = 140457.
The PHP version on my machine is 5.4 and the server is 5.2. is it convenient to replace the namespace function of php5.3 in PHP5.2!
Require ("lib/SplClassLoader. php ");
$ ClassLoader = new SplClassLoader ("WebSocket", "/lib ");
$ ClassLoader-> register ();
$ Server = new \ WebSocket \ Server ("124.172.243.71", 8000, false); // An error is returned here.
The error message is as follows:
Unexpected character in input: '\' (ASCII = 92) state = 1 in
------ Solution --------------------
PHP versions later than 5.3.0 support namespaces.
So you should upgrade the server.
------ Solution --------------------
M, not familiar with namespaces