php长连接,无法连接
本人使用的是阿里云服务器,想使用php长连接,实时从天猫获取数据,代码在本地测试可行,但是上传到服务器上就,不能使用。求指导!以下是phpinfo,
回复讨论(解决方案)
要看到的的代码
代码没有问题,就这个也运行不了
<?phpheader("Content-type: text/html; charset=utf-8"); echo "每隔3秒输出一次<br />";set_time_limit(0); //保证php程序运行不超时退出while(1) { echo date("H:i:s")."<br />"; ob_flush(); flush(); //刷新并输出PHP缓冲数据 sleep(3); //延迟3秒}?>
要看到的的代码
有什么好的意见吗? 1、你 #2 的代码并非长连接,与你的问题有什么关系?
2、你 #2 的代码只是利用了服务器的一个缺陷而达到的视觉效果,并无实用价值
3、你从 阿里云 到 天猫 获取数据,这本身是需要有做够的权限的
而云服务无一例外的禁用了免费的文件操作,那么你是怎么保存与 天猫 沟通时的 cookie 的?
1、你 #2 的代码并非长连接,与你的问题有什么关系?
2、你 #2 的代码只是利用了服务器的一个缺陷而达到的视觉效果,并无实用价值
3、你从 阿里云 到 天猫 获取数据,这本身是需要有做够的权限的
而云服务无一例外的禁用了免费的文件操作,那么你是怎么保存与 天猫 沟通时的 cookie 的?
首先感谢回复,谢谢,请教一下,长连接,这方面不懂。我想的是用长连接,接收数据,这样天猫一推送数据,我立马就可以收到。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

LOL cannot connect to the server, please check the network. In recent years, online games have become a daily entertainment activity for many people. Among them, League of Legends (LOL) is a very popular multiplayer online game, attracting the participation and interest of hundreds of millions of players. However, sometimes when we play LOL, we will encounter the error message "Unable to connect to the server, please check the network", which undoubtedly brings some trouble to players. Next, we will discuss the causes and solutions of this error. First of all, the problem that LOL cannot connect to the server may be

Through Bluetooth devices, we can transfer files without a network connection, or connect Bluetooth headsets to listen to music, etc. However, some netizens recently said that their win10 computer’s Bluetooth cannot connect. What’s going on? The editor below will teach you how to solve the problem that the win10 Bluetooth device cannot be connected. This situation may be caused by a driver problem. The following editor will show you the specific solution: 1. Click the Cortana search box in the lower left corner of win10, enter "Device Manager", click and open "Device Manager". 2. In the device manager, click "Bluetooth". 3. Select "QualcommAtherosBluetooth" in the expanded list. 4. Right-click and select "Update Driver". 5.

Solutions for network printers that cannot connect: 1. Network connection problem; 2. Printer setting problem; 3. Driver problem; 4. System file damage; 5. Firewall or anti-virus software settings; 6. Server service not turned on; 7. Sharing The service is not turned on; 8. The computer browser service is not turned on. Detailed introduction: 1. Network connection problem. First, make sure the network connection is normal. You can test the network connection through the ping command. If the computer cannot ping the network printer, there may be a problem with the network connection. You can try restarting the router or switch, etc.

When you use a win10 computer, have you ever encountered a situation where you are unable to connect to the internet? If you don't know how to solve this problem, let's take a look at this article. 1. Use the Win+I key combination to bring up the settings window, click to select Network and Internet. 2. Click Ethernet on the left side of the Network and INTERNET window, and then click Change Adapter Options in the right window. 3. In the Network Connection window, right-click Ethernet (desktop, please treat mobile devices as appropriate), and click Disable in the menu. 4. After it is displayed as disabled, right-click the Ethernet mouse and execute the enable command. Once Ethernet is enabled, the problem should be resolved. Here is an introduction to Win10 network failure prompt identification without

Recently, many users using Win7 system have found that they cannot connect to the remote desktop. This is probably caused by registry settings. So how to solve it? Let’s take a look below! 1. First, press the "Win+R" keys to open the run window, and enter the "regedit" command to open the registry editor. 2. Then, in the opened registry interface, click to expand "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\TerminalServerClient". 3. Then, right-click on the blank space and select "

Solutions include checking the connection, checking the driver, checking the network connection, checking the printer status, checking the print queue, restarting the device, etc. Detailed introduction: 1. Check the connection: Make sure the printer is turned on and connected correctly to the computer. If using USB connection, please make sure the USB cable is firmly connected and try changing the USB port; 2. Check the driver: Make sure the printer driver is installed correctly. Try to reinstall or update the printer driver. You can download the latest driver from the printer manufacturer's official website; 3. Check the network connection, etc.

The inability to connect to the Steam network refers to the situation where the user cannot connect to the Steam server normally when using the Steam platform. The reasons are as follows: 1. Network connection problem, you should check whether the network connection is normal, restart the router, turn off the firewall or add Steam to the exception list of the firewall; 2. Steam server problem, the user can only wait for the Steam server to return to normal; 3. Computer Or problems with the Steam client, update the operating system and drivers, clear the cache of the Steam client, etc.

What should I do if there is no local connection in win7 system? Win7 system cannot make local connection. How to solve the problem and share the tutorial. After reinstalling win7 system or just installing a new system on the computer, the user finds that his computer cannot connect to the network. Many users will encounter this situation. The reason is that the computer does not have the corresponding driver, and they need to update it or download the driver. Win7 system cannot perform local connection solution operation tutorial sharing 1. If you find that there is no exclamation mark and question mark in front of the network card driver in the device manager, and the driver is normal, then you should consider the error of the network connection management service program. 2. Press and hold the Win key + R key to open the run window. 3. In order
