{"id":43845,"date":"2024-06-12T10:28:32","date_gmt":"2024-06-12T10:28:32","guid":{"rendered":"https:\/\/accuweb.cloud\/resource\/?post_type=faq&#038;p=43845"},"modified":"2026-02-18T13:07:32","modified_gmt":"2026-02-18T13:07:32","slug":"websockets-support-for-php","status":"publish","type":"faq","link":"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php","title":{"rendered":"Websockets Support for Apache &#038; NGINX"},"content":{"rendered":"<h2 class=\"ack-h2\">Websockets Support for Apache &amp; NGINX<\/h2>\n<p>WebSocket technology is a widely used method for instant messaging between a client and server within an application. It establishes a continuous, two-way communication link over TCP, resulting in minimal latency and rapid interaction. This technology can also traverse proxies and firewalls efficiently.<\/p>\n<p>Our platform offers robust WebSocket support by integrating it with the <a class=\"ack-link-color\" target=\"_blank\" rel=\"noopener\" href=\"https:\/\/accuweb.cloud\/resource\/articles\/shared-load-balancer\/\">Shared Load Balancer<\/a> and NGINX balancer node. This allows you to use WebSocket features even without an external IP address, by consolidating various WebSocket app ports into a single port (80 for HTTP and 443 for HTTPS).<\/p>\n<p>The simplest way to set up WebSocket support for your application is by using an NGINX balancer (see detailed instructions in our documentation).<\/p>\n<p>However, if this approach doesn&#8217;t meet your needs, the platform fully supports WebSockets on available application servers like Apache (for PHP, Ruby, and <a class=\"ack-link-color\" target=\"_blank\" rel=\"noopener\" href=\"https:\/\/accuweb.cloud\/application\/python-hosting\">Python<\/a> apps) and NGINX (for <a class=\"ack-link-color\" target=\"_blank\" rel=\"noopener\" href=\"https:\/\/accuweb.cloud\/application\/php-hosting\">PHP<\/a> and <a class=\"ack-link-color\" target=\"_blank\" rel=\"noopener\" href=\"https:\/\/accuweb.cloud\/application\/ruby-hosting\">Ruby<\/a> apps).<\/p>\n<p>The process of integrating WebSockets can vary depending on your application. We provide configuration samples for each of these server nodes, making it easy to enable WebSocket support by uncommenting and adjusting a few settings, such as the listener port number, to fit your app&#8217;s requirements.<\/p>\n<p>In the step-by-step tutorial below, we&#8217;ll demonstrate an example of configuring WebSockets for a simple PHP chat project deployed without a balancer server, utilizing WebSocket technology. Let&#8217;s begin from the start.<\/p>\n<h2 class=\"ack-h2\">Create an Environment and Deploy the Application<\/h2>\n<p>Using the platform, you can easily <a class=\"ack-link-color\" target=\"_blank\" rel=\"noopener\" href=\"https:\/\/accuweb.cloud\/resource\/articles\/creating-and-managing-environment\/\">create the environment<\/a> you need in just a few clicks. Simply log into your PaaS account and follow these steps:<\/p>\n<p><strong>Step 1.<\/strong> Click the &#8220;<strong>New Environment<\/strong>&#8221; button located in the top left corner of the dashboard.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/New-Environment-6.png\"><img fetchpriority=\"high\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-43847 size-full\" title=\"New Environment\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/New-Environment-6.png\" alt=\"New Environment\" width=\"1367\" height=\"117\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/New-Environment-6.png 1367w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/New-Environment-6-300x26.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/New-Environment-6-1024x88.png 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/New-Environment-6-768x66.png 768w\" sizes=\"(max-width: 1367px) 100vw, 1367px\" \/><\/a><\/p>\n<p><strong>Step 2.<\/strong>\u00a0In the Environment Wizard window that appears, navigate to the tab for your chosen programming language. Select the desired application server (for our example, we&#8217;ll use <strong>Apache<\/strong> to serve our PHP application). Use the <a class=\"ack-link-color\" target=\"_blank\" rel=\"noopener\" href=\"https:\/\/accuweb.cloud\/resource\/articles\/what-is-cloudlets\/\">cloudlet<\/a> sliders to allocate the necessary resources. Enter a name for your environment (e.g., apache-WebSockets) and then click &#8220;<strong>Create<\/strong>.&#8221;<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Environment-Topology.png\"><img decoding=\"async\" class=\"ack-article-image aligncenter wp-image-43851 size-full\" title=\"Environment Topology\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Environment-Topology.png\" alt=\"Environment Topology\" width=\"1222\" height=\"761\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Environment-Topology.png 1222w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Environment-Topology-300x187.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Environment-Topology-1024x638.png 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Environment-Topology-768x478.png 768w\" sizes=\"(max-width: 1222px) 100vw, 1222px\" \/><\/a><\/p>\n<p><strong>Step 3.<\/strong>\u00a0Your new environment will appear on the dashboard in a few minutes.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Creating-Environment.png\"><img decoding=\"async\" class=\"ack-article-image aligncenter wp-image-43852 size-full\" title=\"Creating Environment\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Creating-Environment.png\" alt=\"Creating Environment\" width=\"1543\" height=\"201\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Creating-Environment.png 1543w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Creating-Environment-300x39.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Creating-Environment-1024x133.png 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Creating-Environment-768x100.png 768w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Creating-Environment-1536x200.png 1536w\" sizes=\"(max-width: 1543px) 100vw, 1543px\" \/><\/a><\/p>\n<p><strong>Step 4.<\/strong> Upload and deploy your application using the platform&#8217;s Deployment Manager or through a remote GIT\/SVN repository. Detailed instructions for deploying based on your chosen engine can be found in our Deployment Guide.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Created-Environment-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-43853 size-full\" title=\"Created Environment\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Created-Environment-1.png\" alt=\"Created Environment\" width=\"1542\" height=\"243\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Created-Environment-1.png 1542w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Created-Environment-1-300x47.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Created-Environment-1-1024x161.png 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Created-Environment-1-768x121.png 768w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Created-Environment-1-1536x242.png 1536w\" sizes=\"(max-width: 1542px) 100vw, 1542px\" \/><\/a><\/p>\n<p>As a result, your deployed project will appear in the corresponding section within the environment&#8217;s panel.<\/p>\n<h2 class=\"ack-h2\">Server and Application Configurations<\/h2>\n<p>WebSocket support in the Apache server is enabled through the proxy_wstunnel_module module, which is included in the default server build. NGINX, on the other hand, can proxy WebSocket connections directly within the application server, similar to how NGINX-balancer operates.<\/p>\n<p>Now, let&#8217;s configure your application server.<\/p>\n<p><strong>Step 1.<\/strong> Click the &#8220;<a class=\"ack-link-color\" target=\"_blank\" rel=\"noopener\" href=\"https:\/\/accuweb.cloud\/resource\/articles\/configuration-of-file-manager\/\">Config<\/a>&#8221; button next to your application server node.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Config-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-43854 size-full\" title=\"Config\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Config-2.png\" alt=\"Config\" width=\"1543\" height=\"239\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Config-2.png 1543w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Config-2-300x46.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Config-2-1024x159.png 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Config-2-768x119.png 768w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Config-2-1536x238.png 1536w\" sizes=\"(max-width: 1543px) 100vw, 1543px\" \/><\/a><\/p>\n<p><strong>Step 2.<\/strong> In the Configuration Manager tab that opens, follow the steps in one of the instruction sections based on your chosen server:<\/p>\n<div class=\"article-space\"><\/div>\n\t\t<div data-elementor-type=\"section\" data-elementor-id=\"38668\" class=\"elementor elementor-38668\" data-elementor-settings=\"{&quot;ha_cmc_init_switcher&quot;:&quot;no&quot;}\" data-elementor-post-type=\"elementor_library\">\n\t\t\t        <section class=\"elementor-section elementor-top-section elementor-element elementor-element-882321f elementor-section-boxed elementor-section-height-default elementor-section-height-default ct-header-fixed-none ct-row-max-none\" data-id=\"882321f\" data-element_type=\"section\" data-settings=\"{&quot;_ha_eqh_enable&quot;:false}\">\n            \n                        <div class=\"elementor-container elementor-column-gap-default \">\n                    <div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7cc79cc\" data-id=\"7cc79cc\" data-element_type=\"column\">\n        <div class=\"elementor-widget-wrap elementor-element-populated\">\n                    \n        \t\t<div class=\"elementor-element elementor-element-e31b40f elementor-widget elementor-widget-shortcode\" data-id=\"e31b40f\" data-element_type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-shortcode\"><\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t            <\/div>\n        <\/div>\n                    <\/div>\n        <\/section>\n        \t\t<\/div>\n\t\t\n<div class=\"article-space\"><\/div>\n<h3 class=\"ack-h3\">For Apache application server<\/h3>\n<p>Locate the `<strong>httpd.conf<\/strong>` file in the `<strong>conf<\/strong>` directory and uncomment the specific lines at the end of the file (around line 962).<\/p>\n<pre><code class=\"language-javascript\">\r\n&lt;Location \/ws&gt;\r\nProxyPass ws:\/\/127.0.0.1:&lt;PORT&gt;\r\nProxyPassReverse ws:\/\/127.0.0.1:&lt;PORT&gt;\r\n&lt;\/Location&gt;<\/code><\/pre>\n<div class=\"article-space\"><\/div>\n<p>Now, update both parameters to match the port number used by your WebSocket application (for example, ours uses port 9000).<\/p>\n<p>Ensure that it matches the configuration shown in the image below.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Configuration-Manager-Settings.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-43855 size-full\" title=\"Configuration Manager Settings\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Configuration-Manager-Settings.png\" alt=\"Configuration Manager Settings\" width=\"1600\" height=\"430\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Configuration-Manager-Settings.png 1600w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Configuration-Manager-Settings-300x81.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Configuration-Manager-Settings-1024x275.png 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Configuration-Manager-Settings-768x206.png 768w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Configuration-Manager-Settings-1536x413.png 1536w\" sizes=\"(max-width: 1600px) 100vw, 1600px\" \/><\/a><\/p>\n<p>Save the changes by clicking the button labeled with the same name above the editor.<\/p>\n<h3 class=\"ack-h3\">For NGINX application server<\/h3>\n<p>Locate the `<strong>nginx.conf<\/strong>` file in the `<strong>conf<\/strong>` directory and uncomment the specific lines in the &#8220;#Websocket support&#8221; section.<\/p>\n<pre><code class=\"language-javascript\">\r\nupstream websocket {\r\nserver 127.0.0.1:&lt;PORT&gt;;\r\n}\r\n&amp;hellip;\r\nlocation \/ws {\r\nproxy_pass http:\/\/websocket;\r\nproxy_http_version 1.1;\r\nproxy_set_header Upgrade $http_upgrade;\r\nproxy_set_header Connection \"Upgrade\";\r\n}<\/code><\/pre>\n<div class=\"article-space\"><\/div>\n<p>Next, replace the `<strong>&lt;PORT&gt;<\/strong>` placeholder with the actual port number used by your WebSocket application, and then save the changes you made.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Change-Port.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-43856 size-full\" title=\"Change Port\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Change-Port.png\" alt=\"Change Port\" width=\"1600\" height=\"511\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Change-Port.png 1600w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Change-Port-300x96.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Change-Port-1024x327.png 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Change-Port-768x245.png 768w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Change-Port-1536x491.png 1536w\" sizes=\"(max-width: 1600px) 100vw, 1600px\" \/><\/a><\/p>\n<p><strong>Step 3.<\/strong> That&#8217;s all the server configurations you need to complete. Now, configure your deployed application by accessing its configuration file responsible for WebSocket settings. Adjust the `ws` path within the file to follow this format:<\/p>\n<pre><code class=\"language-javascript\">```\r\nws:\/\/{env_domain}{path_to_ws_file}\r\n```<\/code><\/pre>\n<p>Here&#8217;s what each part should be replaced with:<\/p>\n<ul class=\"ack-ul\">\n<li><strong>`{env_domain}`:<\/strong> Substitute this with your environment domain (found under the environment name on the dashboard, such as `apache-websockets.jelastic.com` in our case).<\/li>\n<li><strong>`{path_to_ws_file}`:<\/strong> Modify this to reflect the path to the file that should be accessed when establishing the WebSocket connection.<\/li>\n<\/ul>\n<p>Ensure it resembles the example shown in the image below:<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Adjust-ws-Path.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-43857 size-full\" title=\"Adjust 'ws' Path\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Adjust-ws-Path.png\" alt=\"Adjust 'ws' Path\" width=\"1600\" height=\"439\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Adjust-ws-Path.png 1600w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Adjust-ws-Path-300x82.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Adjust-ws-Path-1024x281.png 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Adjust-ws-Path-768x211.png 768w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Adjust-ws-Path-1536x421.png 1536w\" sizes=\"(max-width: 1600px) 100vw, 1600px\" \/><\/a><\/p>\n<p><strong>Step 4.<\/strong> Save the changes and then restart your application server using the appropriate button.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Restart-Node.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-43858 size-full\" title=\"Restart Node\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Restart-Node.png\" alt=\"Restart Node\" width=\"1545\" height=\"335\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Restart-Node.png 1545w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Restart-Node-300x65.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Restart-Node-1024x222.png 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Restart-Node-768x167.png 768w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Restart-Node-1536x333.png 1536w\" sizes=\"(max-width: 1545px) 100vw, 1545px\" \/><\/a><\/p>\n<p><strong>Step 5.<\/strong> Excellent, now it&#8217;s finished! Click on &#8220;<strong>Open in Browser<\/strong>&#8221; to launch your application in a new browser tab.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Open-in-Browser-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-43859 size-full\" title=\"Open in Browser\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Open-in-Browser-2.png\" alt=\"Open in Browser\" width=\"1553\" height=\"332\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Open-in-Browser-2.png 1553w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Open-in-Browser-2-300x64.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Open-in-Browser-2-1024x219.png 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Open-in-Browser-2-768x164.png 768w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Open-in-Browser-2-1536x328.png 1536w\" sizes=\"(max-width: 1553px) 100vw, 1553px\" \/><\/a><\/p>\n<p><strong>Step 6.<\/strong> As you can see, our example chat application is working perfectly.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Chat-Application-Example.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-43860 size-full\" title=\"Chat Application Example\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Chat-Application-Example.png\" alt=\"Chat Application Example\" width=\"1600\" height=\"428\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Chat-Application-Example.png 1600w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Chat-Application-Example-300x80.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Chat-Application-Example-1024x274.png 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Chat-Application-Example-768x205.png 768w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/06\/Chat-Application-Example-1536x411.png 1536w\" sizes=\"(max-width: 1600px) 100vw, 1600px\" \/><\/a><\/p>\n<p>Even when running a simple chat application like this, you&#8217;ll experience the benefits of fast message transfer thanks to using the WebSocket protocol. Enjoy!<\/p>\n<div class=\"cta-btn-top-space\"><\/div>\n\t\t<div data-elementor-type=\"section\" data-elementor-id=\"38668\" class=\"elementor elementor-38668\" data-elementor-settings=\"{&quot;ha_cmc_init_switcher&quot;:&quot;no&quot;}\" data-elementor-post-type=\"elementor_library\">\n\t\t\t        <section class=\"elementor-section elementor-top-section elementor-element elementor-element-882321f elementor-section-boxed elementor-section-height-default elementor-section-height-default ct-header-fixed-none ct-row-max-none\" data-id=\"882321f\" data-element_type=\"section\" data-settings=\"{&quot;_ha_eqh_enable&quot;:false}\">\n            \n                        <div class=\"elementor-container elementor-column-gap-default \">\n                    <div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7cc79cc\" data-id=\"7cc79cc\" data-element_type=\"column\">\n        <div class=\"elementor-widget-wrap elementor-element-populated\">\n                    \n        \t\t<div class=\"elementor-element elementor-element-e31b40f elementor-widget elementor-widget-shortcode\" data-id=\"e31b40f\" data-element_type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-shortcode\"><\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t            <\/div>\n        <\/div>\n                    <\/div>\n        <\/section>\n        \t\t<\/div>\n\t\t\n<div class=\"cta-btn-mob-space\"><\/div>\n","protected":false},"author":1,"featured_media":52879,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","class_list":["post-43845","faq","type-faq","status-publish","has-post-thumbnail","hentry","faq_topics-development-tools","faq_topics-kb","faq_topics-product-documentation","faq_topics-websockets","faq_topics-websockets-support-for-php"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.10 (Yoast SEO v24.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>WebSockets Support for Apache &amp; NGINX Load Balancer<\/title>\n<meta name=\"description\" content=\"Discover seamless WebSocket support for Apache and NGINX servers, ensuring seamless instant messaging and two-way communication.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Websockets Support for Apache &amp; NGINX\" \/>\n<meta property=\"og:description\" content=\"Discover seamless WebSocket support for Apache and NGINX servers, ensuring seamless instant messaging and two-way communication.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php\" \/>\n<meta property=\"og:site_name\" content=\"AccuWeb Cloud\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-18T13:07:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php#article\",\"isPartOf\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php\"},\"author\":{\"name\":\"Jilesh Patadiya\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/#\/schema\/person\/a7a4cbe8405202b537509c757b588c58\"},\"headline\":\"Websockets Support for Apache &#038; NGINX\",\"datePublished\":\"2024-06-12T10:28:32+00:00\",\"dateModified\":\"2026-02-18T13:07:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php\"},\"wordCount\":784,\"publisher\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/#organization\"},\"image\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php#primaryimage\"},\"thumbnailUrl\":\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg\",\"inLanguage\":\"en-US\"},{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php\",\"url\":\"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php\",\"name\":\"WebSockets Support for Apache & NGINX Load Balancer\",\"isPartOf\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php#primaryimage\"},\"image\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php#primaryimage\"},\"thumbnailUrl\":\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg\",\"datePublished\":\"2024-06-12T10:28:32+00:00\",\"dateModified\":\"2026-02-18T13:07:32+00:00\",\"description\":\"Discover seamless WebSocket support for Apache and NGINX servers, ensuring seamless instant messaging and two-way communication.\",\"breadcrumb\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php#primaryimage\",\"url\":\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg\",\"contentUrl\":\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/accuweb.cloud\/resource\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Websockets Support for Apache &#038; NGINX\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/#website\",\"url\":\"https:\/\/accuweb.cloud\/resource\/\",\"name\":\"AccuWeb Cloud\",\"description\":\"Cutting Edge Cloud Computing\",\"publisher\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/accuweb.cloud\/resource\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/#organization\",\"name\":\"AccuWeb.Cloud\",\"url\":\"https:\/\/accuweb.cloud\/resource\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/04\/accuwebcloud_logo_black_tagline.jpg\",\"contentUrl\":\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/04\/accuwebcloud_logo_black_tagline.jpg\",\"width\":156,\"height\":87,\"caption\":\"AccuWeb.Cloud\"},\"image\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/#\/schema\/person\/a7a4cbe8405202b537509c757b588c58\",\"name\":\"Jilesh Patadiya\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2cea2bdb5bbabb771ee67e96acad7396f25cb1a0c360b9bc4a9ac40cea9cd8b2?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2cea2bdb5bbabb771ee67e96acad7396f25cb1a0c360b9bc4a9ac40cea9cd8b2?s=96&d=mm&r=g\",\"caption\":\"Jilesh Patadiya\"},\"description\":\"Jilesh Patadiya, the visionary Co-Founder and Chief Technology Officer (CTO) behind AccuWeb.Cloud. Founder &amp; CTO at AccuWebHosting.com. He shares his web hosting insights on the AccuWeb.Cloud blog. He mostly writes on the latest web hosting trends, WordPress, storage technologies, and Windows and Linux hosting platforms.\",\"sameAs\":[\"https:\/\/accuweb.cloud\/resource\",\"https:\/\/www.facebook.com\/accuwebhosting\",\"https:\/\/www.instagram.com\/accuwebhosting\/\",\"https:\/\/www.linkedin.com\/company\/accuwebhosting\/\",\"https:\/\/x.com\/accuwebhosting\",\"https:\/\/www.youtube.com\/c\/Accuwebhosting\"],\"url\":\"https:\/\/accuweb.cloud\/resource\/author\/accuwebadmin\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"WebSockets Support for Apache & NGINX Load Balancer","description":"Discover seamless WebSocket support for Apache and NGINX servers, ensuring seamless instant messaging and two-way communication.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php","og_locale":"en_US","og_type":"article","og_title":"Websockets Support for Apache & NGINX","og_description":"Discover seamless WebSocket support for Apache and NGINX servers, ensuring seamless instant messaging and two-way communication.","og_url":"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php","og_site_name":"AccuWeb Cloud","article_modified_time":"2026-02-18T13:07:32+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php#article","isPartOf":{"@id":"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php"},"author":{"name":"Jilesh Patadiya","@id":"https:\/\/accuweb.cloud\/resource\/#\/schema\/person\/a7a4cbe8405202b537509c757b588c58"},"headline":"Websockets Support for Apache &#038; NGINX","datePublished":"2024-06-12T10:28:32+00:00","dateModified":"2026-02-18T13:07:32+00:00","mainEntityOfPage":{"@id":"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php"},"wordCount":784,"publisher":{"@id":"https:\/\/accuweb.cloud\/resource\/#organization"},"image":{"@id":"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php#primaryimage"},"thumbnailUrl":"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg","inLanguage":"en-US"},{"@type":["WebPage","FAQPage"],"@id":"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php","url":"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php","name":"WebSockets Support for Apache & NGINX Load Balancer","isPartOf":{"@id":"https:\/\/accuweb.cloud\/resource\/#website"},"primaryImageOfPage":{"@id":"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php#primaryimage"},"image":{"@id":"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php#primaryimage"},"thumbnailUrl":"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg","datePublished":"2024-06-12T10:28:32+00:00","dateModified":"2026-02-18T13:07:32+00:00","description":"Discover seamless WebSocket support for Apache and NGINX servers, ensuring seamless instant messaging and two-way communication.","breadcrumb":{"@id":"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php#primaryimage","url":"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg","contentUrl":"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/accuweb.cloud\/resource\/articles\/websockets-support-for-php#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/accuweb.cloud\/resource\/"},{"@type":"ListItem","position":2,"name":"Websockets Support for Apache &#038; NGINX"}]},{"@type":"WebSite","@id":"https:\/\/accuweb.cloud\/resource\/#website","url":"https:\/\/accuweb.cloud\/resource\/","name":"AccuWeb Cloud","description":"Cutting Edge Cloud Computing","publisher":{"@id":"https:\/\/accuweb.cloud\/resource\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/accuweb.cloud\/resource\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/accuweb.cloud\/resource\/#organization","name":"AccuWeb.Cloud","url":"https:\/\/accuweb.cloud\/resource\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/accuweb.cloud\/resource\/#\/schema\/logo\/image\/","url":"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/04\/accuwebcloud_logo_black_tagline.jpg","contentUrl":"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/04\/accuwebcloud_logo_black_tagline.jpg","width":156,"height":87,"caption":"AccuWeb.Cloud"},"image":{"@id":"https:\/\/accuweb.cloud\/resource\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/accuweb.cloud\/resource\/#\/schema\/person\/a7a4cbe8405202b537509c757b588c58","name":"Jilesh Patadiya","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/accuweb.cloud\/resource\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2cea2bdb5bbabb771ee67e96acad7396f25cb1a0c360b9bc4a9ac40cea9cd8b2?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2cea2bdb5bbabb771ee67e96acad7396f25cb1a0c360b9bc4a9ac40cea9cd8b2?s=96&d=mm&r=g","caption":"Jilesh Patadiya"},"description":"Jilesh Patadiya, the visionary Co-Founder and Chief Technology Officer (CTO) behind AccuWeb.Cloud. Founder &amp; CTO at AccuWebHosting.com. He shares his web hosting insights on the AccuWeb.Cloud blog. He mostly writes on the latest web hosting trends, WordPress, storage technologies, and Windows and Linux hosting platforms.","sameAs":["https:\/\/accuweb.cloud\/resource","https:\/\/www.facebook.com\/accuwebhosting","https:\/\/www.instagram.com\/accuwebhosting\/","https:\/\/www.linkedin.com\/company\/accuwebhosting\/","https:\/\/x.com\/accuwebhosting","https:\/\/www.youtube.com\/c\/Accuwebhosting"],"url":"https:\/\/accuweb.cloud\/resource\/author\/accuwebadmin"}]}},"_links":{"self":[{"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/faq\/43845","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/faq"}],"about":[{"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/types\/faq"}],"author":[{"embeddable":true,"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/comments?post=43845"}],"version-history":[{"count":8,"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/faq\/43845\/revisions"}],"predecessor-version":[{"id":53135,"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/faq\/43845\/revisions\/53135"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/media\/52879"}],"wp:attachment":[{"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/media?parent=43845"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}