I'm trying to setup a websocket server in a development pc. I've been trying a few examples from github and all of them with the same result. Error 500 after a few minutes.
I already have enabled the websocket protocol on Windows optional resources, the extension is included in the php.ini file. I tried running the scripts on CMD and nothing seems to work. I also tried inserting a few breakpoints using xdebug and the script is being reached, it just keep refusing to perform the handshake. Is there anything that I may be missing?
The PC is running Windows 10, with PHP 5.6.3.
Related
between yesterday and today something happened that prevents processes running under Apache accessing an MSSQL server that is essential for functioning of the site.
This is what I find in the Apache error logs for PHP scripts:
PHP Warning: mssql_connect(): Unable to connect to server
Flask/SQLAlchemy applications are a bit more informative:
OperationalError: (OperationalError) (20009, 'DB-Lib error message 20009,
severity 9:\\nUnable to connect: Adaptive Server is unavailable or does
not exist (####:1234)\\nNet-Lib error during Permission
denied(13)\\n') None None
When I start the same WSGI app in test mode from the console on the same machine that Apache is running on, everything works. To summarize:
Both WSGI and PHP fail to connect to an MSSQL server literally overnight if run under Apache
When run w/o Apache, the WSGI scripts work fine (can't tell about PHP because that's not my domain)
Nothing was changed on the server that runs the web applications (can't say about the MSSQL server)
I need a clue quick. This stuff is running in a company intranet and people are getting impatient. I have control only over the RHEL server running Apache, not the MSSQL server.
The troubleshooting tips using tsql on the freetds page all work fine.
My /etc/freetds.conf is just out of the box and essentially empty (everything commented out).
Turns out it had nothing to do with Apache et al. This was an SELinux permission issue which started after the VM was rebooted during the night, probably initiated by a sysop in India. Apparently there was an updated security policy for apache. Found the issue in /var/log/messages, which thankfully even included instructions on how to fix it.
I'm taking over the development of a php project using Laravel framework and beanstalkd driver for queuing jobs. This application was passed from a Mac development environment (that runs a beanstalkd driver) to a Windows 7 environment (beanstalkd not available for Windows machine -- at least not without cygwin tricks). So I've decided to use Vagrant homestead vm on VirtualBox that comes with an entire set of tools and servers including beanstalkd.
The application runs fine on my localhost until I try to send form data through POST header. I kept getting a "417 Expectation failed" HTTP error. I read somewhere that there maybe an issue with my proxy and could be fixed by disabling it. But as I see it, no proxy is used in my host machine -- I don't know about the guest (vm) though.
Could anyone help me solve this issue? Thanks.
I have set up a DMZ to run a web site. Most of the code is on an application server running Debian Release 7.0 (wheezy) 64-bit. I also have a web server running CentOS 6.5. It acts as a proxy for the application server. I have set up LAMP on both and my web pages are written in PHP. A PHP script on the web server calls a PHP script on the application server. The application server script calls a long running (> 1 minute) executable (that had been developed in C++). After 60 seconds (timed by my watch), the script fails with the following message.
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request POST /appServer/scriptName.php.
Reason: Error reading from remote server
Apache/2.2.15 (CentOS) Server at sitename.com Port 80
I commented out code in the application server PHP script and narrowed the problem down to the long-running C++ executable. I also ran the executable in the shell without any problems. So there is clearly a time-out issue and it seems to be associated with the web server. I have only recently replaced an old version of Ubuntu, with Centos 6.5, on the web server and I did not have this problem before I did that. Also, the PHP code is the same as before I made the switch and it did not give me this problem prior to that. So I am convinced that the problem lies with something on the web server and one of the setting I have, with php or apache, on the new system.
I edited /etc/php.ini, on the web server, and changed all of the uncommented-out 60 second time limits (max_input_time, default_socket_timeout, mysql.connect_timeout) from 60 seconds to 600 seconds. I still get the above proxy error after 60 seconds.
Solution.
On the (CentOS) web server, edit /etc/httpd/conf/httpd.conf
Include the line
ProxyPass /appServer/ http://[private IP address]/ timeout=600 Keepalive=On
Specifically add the
timeout=600 Keepalive=On
part.
I also restarted apache to be on the safe side.
I seem to be having issues with running wkhtmltopdf through a proc_open() on Ubuntu Server 12.04 with PHP 5.3.10.
What seems to happen (on several servers) when running solely with Apache is that the process is opened successfully, the data is written to and the PDF comes out of the other end of the process.
However, when running the same code through a setup with Nginx as a proxy and Apache as the upstream server, the fwrite() to stdin seems to hang/become unresponsive with anything more than approximately 1200 bytes.
The static binary version 0.10.0-rc2 seems to be working fine on its own, and can render any page it can access, so I'm not sure what's causing the issue here.
Edit: It doesn't seem to be Nginx, as I've put that in front of Apache on an AWS box and it still works.
You need to run "tail -f " and run the PHP script. You will hopefully see the error message appearing and that will guide you in the right direction.
This was the result of the Nginx server not having a specific hosts entry for the domain name it was using in the request. The request entered a loop, continually hitting the external address and redirecting to it, rather than resolving locally.
I have a slight problem and cannot for the life of me figure out what is happening. I am running a Linux machine on a server with APC enabled. Everything works fine.
Now when I enable APC on Windows the server starts terminating the connection. You know, the "Site currently unavailable" message Firefox spits out.
I tried the access logs, error logs and there is nothing there to indicate an error. How could APC influence on a server like this?
BTW: I have a CMS on my local server/live server. On the live server it works great with APC. On the dev server the connection terminates. The strange thing is, simpler scripts execute just fine. The CMS is using CakePHP.
Any help would be very appreciated.
I tried the access logs, error logs and there is nothing there to indicate an error.
This is not very helpful - did you check to see if the request is logged at all?
Is every request to the webserver affected? Just the PHP scripts? All the PHP scripts?
My guess would be that you have the wrong version of APC installed or have loaded it along with another opcode cache (e.g. Zend optimizer)
C.