在MAC下安装swoole,顺着文档安装也成功了,具体的细节是:我把系统的php切换成MAMP的php,然后安装swoole。最后的php-m命令中也已经有swoole在了,但是phpinfo中却搜索不到swoole的字样然后使用如下代码测试classClient{private$client;publicfunction__construct(){$this->client=newswoole_client(SWOOLE_SOCK_TCP);}publicfunctionconnect(){if(!$this->client->connect("127.0.0.1",9501,1)){echo"Error:{$fp->errMsg}[{$fp->errCode}]\n";}$message=$this->client->recv();echo"GetMessageFromServer:{$message}\n";fwrite(STDOUT,"请输入消息:");$msg=trim(fgets(STDIN));$this->client->send($msg);}publicfunctiontest(){$this->client=newswoole_client(SWOOLE_SOCK_TCP);}}$client=newClient();$client->connect();返回:Fatalerror:Class'swoole_client'notfoundin/Applications/MAMP/htdocs/swoole_example/01/swoole_simple_client.phponline8更新于(2015-08-07)另一方方面:php-i|grepswoole返回swooleswoolesupport=>enabledswoole.aio_thread_num=>2=>2swoole.display_errors=>On=>Onswoole.message_queue_key=>0=>0swoole.unixsock_buffer_size=>8388608=>8388608php-i|more里的ConfigurationFile(php.ini)Path=>/Applications/MAMP/bin/php/php5.5.18/confLoadedConfigurationFile=>/Applications/MAMP/bin/php/php5.5.18/conf/php.ini,phpinfo里的ConfigurationFile(php.ini)Path=>/Applications/MAMP/bin/php/php5.5.18/confLoadedConfigurationFile=>/Library/ApplicationSupport/appsolute/MAMPPRO/conf/php.ini发现只有LoadedCongigurationFile不同,首先1./Applications/MAMP/bin/php/php5.5.18/conf/php.ini已经写了extension=swoole.so2/Library/ApplicationSupport/appsolute/MAMPPRO/conf/php.ini里面没有swoole.so3.重启MAMP已经尝试过了
万千封印
相关分类