background preloader

Nginx/php stuff to sort

Facebook Twitter

Ngx_core_module.html#error_log. Example Configuration user www www; worker_processes 2; error_log /var/log/nginx-error.log info; events { use kqueue; worker_connections 2048; } ...

ngx_core_module.html#error_log

Directives If accept_mutex is enabled, worker processes will accept new connections by turn. Otherwise, all worker processes will be notified about new connections, and if volume of new connections is low, some of the worker processes may just waste system resources. There is no need to enable accept_mutex on systems that support the EPOLLEXCLUSIVE flag (1.11.3) or when using reuseport. Prior to version 1.11.3, the default value was on. If accept_mutex is enabled, specifies the maximum time during which a worker process will try to restart accepting new connections if another worker process is currently accepting new connections. Connection processing methods (events.html #epoll) PHP FastCGI Example. Download - PHP-FPM. PHP-FPM is finally in PHP core!

Download - PHP-FPM

It is based off of the 0.6.x series in Launchpad, and is now the "officially" supported release. All the different versions of PHP-FPM are below. Get Download. Getting a Git Repository. If you can read only one chapter to get going with Git, this is it.

Getting a Git Repository

This chapter covers every basic command you need to do the vast majority of the things you’ll eventually spend your time doing with Git. By the end of the chapter, you should be able to configure and initialize a repository, begin and stop tracking files, and stage and commit changes. We’ll also show you how to set up Git to ignore certain files and file patterns, how to undo mistakes quickly and easily, how to browse the history of your project and view changes between commits, and how to push and pull from remote repositories.

Initializing a Repository in an Existing Directory. Apache Subversion Source Code. You can install Subversion by compiling its source code release directly, or you can install one of the prepackaged binaries if there is one for your operating system.

Apache Subversion Source Code

Unless a release has "alpha", "beta", or "rc" in its name, it is tested and considered stable for production use. When upgrading, just install "on top of" the older release. Postgresql - Error while loading shared libraries: libpq.so.5: cannot open shared object file: No such file or directory. Print. I have written a script to benchmark the several methods of outputting data in PHP: via single quotes, double quotes, heredoc, and printf.

print

The script constructs a paragraph of text with each method. It performs this construction 10,000 times, then records how long it took. In total, it prints 160,000 times and records 16 timings. Here are the raw results. Outputted straight to browser-- Your first PHP-enabled page. Create a file named and put it in your web server's root directory () with the following content: Example #1 Our first PHP script: <html> <head> <title>PHP Test</title> </head> <body> <?

Your first PHP-enabled page

Php echo '<p>Hello World</p>'; ? > </body></html> Use your browser to access the file with your web server's URL, ending with the /hello.php file reference. <html><head><title>PHP Test</title></head><body><p>Hello World</p></body></html> This program is extremely simple and you really did not need to use PHP to create a page like this. If you tried this example and it did not output anything, it prompted for download, or you see the whole file as text, chances are that the server you are on does not have PHP enabled, or is not configured properly. The point of the example is to show the special PHP tag format.

Note: A Note on Line Feeds Line feeds have little meaning in HTML, however it is still a good idea to make your HTML look nice and clean by putting line feeds in. Logging and Monitoring. This section describes how to configure logging of errors and processed requests in NGINX Open Source and NGINX Plus.

Logging and Monitoring

In This Section Setting Up the Error Log NGINX writes information about encountered issues of different severity levels to the error log. The error_log directive sets up logging to a particular file, stderr, or syslog and specifies the minimal severity level of messages to log. By default, the error log is located at logs/error.log (the absolute path depends on the operating system and installation), and messages from all severity levels above the one specified are logged.

The configuration below changes the minimal severity level of error messages to log from error to warn: error_log logs/error.log warn; In this case, messages of warn, error crit, alert, and emerg levels are logged. The default setting of the error log works globally. A debugging log. To enable a debugging log, nginx needs to be configured to support debugging during the build: .

A debugging log

/configure --with-debug ... Then the debug level should be set with the error_log directive: Download - PHP-FPM. Php fpm - Nginx 1 FastCGI sent in stderr: “Primary script unknown” Beginner’s Guide. Understanding and Implementing FastCGI Proxying in Nginx. Introduction Nginx has become one of the most flexible and powerful web server solutions available.

Understanding and Implementing FastCGI Proxying in Nginx

However, in terms of design, it is first and foremost a proxy server. This focus means that Nginx is very performant when working to handle requests with other servers. Nginx can proxy requests using http, FastCGI, uwsgi, SCGI, or memcached. In this guide, we will discuss FastCGI proxying, which is one of the most common proxying protocols. How to remove location block from $uri in nginx configuration? Beginner’s Guide. Nginx - How do you restart php-fpm? Nginx (Web Server)