草庐IT

nly-work

全部标签

php - fsockopen() : unable to connect not work with PHP (Connection timed out)

我有这个代码:$domain='massag.com';$hosts=array();$mxweights=array();getmxrr($domain,$hosts,$mxweights);var_dump($hosts);var_dump($mxweights);$host=gethostbynamel($hosts[0])[0];var_dump($host);$f=@fsockopen($host,25,$errno,$errstr,10);if(!$f){var_dump('NOTCONNECTED');}它没有连接到smtp服务器但是当我使用命令时smtp:217.196

php - 基于 Laravel session 的身份验证 :api middleware not working

我尝试使用Laravel5.3的AuthScaffolding,包括api路由。我想为api守卫使用session驱动程序,但显然这没有任何影响。在我使用有效用户登录应用程序后(所以我从/login到/home)我尝试输入路径/api/user,但它总是将我重定向到/home。RedirectIfAuthenticated中间件重定向用户。以下是我的尝试以及测试应用程序的快速概览://In"app\Http\Middleware\RedirectIfAuthenticated.php"if(Auth::guard($guard)->check()){returnredirect('/h

php - Wamp 服务器 : Multiple Virtual Hosts are not working on Windows

我在Windows上有两个虚拟主机(例如:test1.dev和test2.dev)。但它总是为两个虚拟主机加载test1.dev的内容。以下是我的文件:主持人:127.0.0.1localhost127.0.0.1test1.dev127.0.0.1test2.devhttpd.conf:SSLRandomSeedstartupbuiltinSSLRandomSeedconnectbuiltinInclude"c:/wamp/alias/*"ServerNametest1.devDocumentRoot"C:\wamp\www\test1\public"ServerNametest2.

php - Facebook 图谱 API 更改 : Picture type (size) no longer working?

根据Facebook的GraphAPI文档(here),您可以通过以下URL访问用户个人资料图片的各种尺寸:https://graph.facebook.com/(userid)/picture?type=smallhttps://graph.facebook.com/(userid)/picture?type=large您会注意到,第一个解析为以_t.jpg(小缩略图)结尾的url,第二个以_n.jpg(大图像)结尾。到目前为止,一切都很好。同样,我们应该能够像这样查询这些图像:https://graph.facebook.com/(userid)?fields=picture&ty

php - Laravel 4 授权 :attempt not working

我在使用Laravel4Auth::attempt方法时遇到了困难,遵循了正确的文档,阅读了几个SO线程,但我仍然无法让它工作。$userData=array('email'=>'admin@admin.com','password'=>'admin');if(Auth::attempt($userData)){//redirect}else{echo'Invalid';}每次都返回无效现在我不确定真正的原因是什么。在我的config/auth.php中有以下内容'eloquent',/*|------------------------------------------------

php - 拉维尔 5.2 : csrf token doesn't work

嗨,为什么我的csrftoken值为空?当我不使用token时,我没有TokenMismatchException!!!!我该如何解决?我深入挖掘,发现session未在SessionServiceProvider中注册。默认情况下是否需要启用某些功能才能使其正常工作?由于我是Laravel初学者,我不确定如何遵循上述建议。如何确保我的路由添加到“web”组下?"> 最佳答案 确保您的路由应用了webmilddleware。几乎任何您需要session、csrf保护、加密cookie、session错误等的路由……您都需要应用“we

PHP : apc_store doesn't work as intended

我已经开始尝试APC在每个网络服务器上存储一些特定的数据,作为对memcached的补充。但是,下面的代码片段让我很头疼:echoapc_store('key','value');echoapc_store('key','newvalue');echoapc_fetch('key');//Echoes:value内存缓存示例:$memcached=newMemcached;$memcached->addServer('localhost','11211');$memcached->set('key','value1');echo$memcached->get('key').'';//E

php - 获取 exsl :node-set to work in PHP

我有以下PHP代码,但无法正常工作。我没有看到任何错误,但也许我只是瞎了眼。我在PHP5.3.1上运行它。HelloworldFooBartest@example.comHEREDOC;$xml_dom=newDOMDocument("1.0","utf-8");$xml_dom->appendChild($xml_dom->createElement("dummy"));$xsl_dom=newDOMDocument();$xsl_dom->loadXML($xsl_string);$xsl_processor=newXSLTProcessor();$xsl_processor->i

php - Doctrine : OneToOne entity relationship doesn't work

我正在使用php,我有两个实体Message和Post。帖子是消息实体中的一个属性,它应该是一对一的单向关系。但是当我在我的Controller中调用message->getPost()->getText()时,我收到了这个错误消息:Tryingtogetpropertyofnon-objectinC:\wamp64\www\Test\monApplication\controller\mainController.php消息实体:post;}publicfunctiongetLikes(){return$this->likes;}}?>Post实体我的数据库连接类:DB,'user'

php - Symfony 学说 :schema:update not working

我有一个奇怪的问题:我有一个应用程序symfony2.3(与奏鸣曲用户)我创建了一个包含一个实体的包-该实体的创建没有问题然后我不得不修改实体,现在似乎无法修改架构:为了看看会发生什么,我用+1增加了所有字符串的长度实体代码(带注解):namespaceToo\ConfigAppBundle\Entity;useGedmo\Mapping\AnnotationasGedmo;useDoctrine\ORM\MappingasORM;/***ConfigApp**@ORM\Table(name="ConfigApp")*@ORM\Entity(repositoryClass="Too\C