Results for “PHP”

Top 10 PHP Frameworks of 2014

PHP frameworks are highly useful tools that help developers build clean, organized, and structured web applications while also accelerating the speed of creation and maintenance. Here, we will introduce the top 10 most popular PHP frameworks (in no particular order). Laravel
This …

Nginx+PHP Causing Excessive TIME_WAIT Connections

Original work, reprinting allowed. When reprinting, please be sure to indicate the original source, author information, and this statement in the form of a hyperlink. Otherwise, legal liability will be pursued. http://leven.blog.51cto.com/1675811/382097

1. Causes of TIME_WAIT: 1. The existing load balancing module of nginx …

PHP Session Cross-Subdomain Issues Summary

Today, I ran into an issue while working on a project. Previously, when dealing with sessions, I would typically store them directly in the database, which solves cross-domain problems — not just cross-subdomain ones. But today’s issue was different: I had to make modifications on top of someone else’s existing work. Since it only involved subdomains, I was confident there had to be a simple solution. After Googling (Baidu-ing) for about 10 minutes, I got it sorted.

Hands-on Nginx and PHP (FastCGI) Installation, Configuration and Optimization

I. What is FastCGI
FastCGI is a scalable, high-speed interface for communication between HTTP servers and dynamic scripting languages. Most popular HTTP servers support FastCGI, including Apache, Nginx, and lighttpd. At the same time, FastCGI is also supported by many scripting languages, including PHP.
FastCGI evolved and improved from CGI. The main drawback of the traditional CGI interface is poor performance, because every time the HTTP server encounters a dynamic program it needs to restart the script parser to perform parsing, and then the result is returned to the HTTP server. When handling high-concurrency access, this is almost unusable. Additionally, the traditional CGI interface method has poor security and is now rarely used.
The FastCGI interface method uses a C/S architecture, allowing the HTTP server and the script parsing server to be separated, while starting one or more script parsing daemon processes on the script parsing server. Whenever the HTTP server encounters a dynamic program, it can directly deliver it to the FastCGI process for execution, and then return the obtained result to the browser. This method allows the HTTP server to focus on handling static requests or returning the results of the dynamic script server to the client, which greatly improves the performance of the entire application system.

Analysis and Fix for High CPU Load Caused by Too Many php-cgi Processes

Server Environment: Red Hat Linux 5.5, Nginx, PHP FastCGI. In this environment, php-cgi typically runs very stably, but we have encountered situations where php-cgi consumes too many CPU resources, causing the server to respond too slowly. The reasons I’ve seen for php-cgi processes consuming excessive CPU resources include: 1. Some PHP …

PHP Session Handling Across Domains and Servers

Cross-Domain and Cross-Server Session Solutions in PHP:
After researching online, I found that except for ASP.NET, all session persistence relies on the session ID. Opinions vary on where to store sessions, with the main options being: shared files, databases, and memcache. Therefore, the core issue revolves around the session i …