PHP

Facebook Twitter

Generating a gdb backtrace. Noticing PHP crashes There's no absolute way to know that PHP is crashing, but there may be signs.

Generating a gdb backtrace

Typically, if you access a page that is always supposed to generate output (has a leading HTML block, for example), and suddenly get "Document contains no data" from your browser, it may mean that PHP crashes somewhere along the execution of the script. Another way to tell that PHP is crashing is by looking at the Apache error logs, and looking for SEGV (Apache 1.2) or Segmentation Fault (Apache 1.3). Important! Nginx. PHP-FPM. PHP Accelerators. This is a list of PHP accelerators.

PHP Accelerators

Alternative PHP Cache (APC)[edit] Alternative PHP Cache is a free, open source (PHP license) framework that caches the output of the PHP bytecode compiler in shared memory, thus reducing parsing and disk I/O overhead for later requests; and a shared memory cache for user data. APC. Command line usage. Spawning php-win.exe as a child process to handle scripting in Windows applications has a few quirks (all having to do with pipes between Windows apps and console apps).

Command line usage

To do this in C++: // We will run php.exe as a child process after creating // two pipes and attaching them to stdin and stdout // of the child process // Define sa struct such that child inherits our handles SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES) }; sa.bInheritHandle = TRUE; sa.lpSecurityDescriptor = NULL; // Create the handles for our two pipes (two handles per pipe, one for each end) // We will have one pipe for stdin, and one for stdout, each with a READ and WRITE end HANDLE hStdoutRd, hStdoutWr, hStdinRd, hStdinWr; PHP on the Command Line 1/2. We all know PHP is a great language for building Web applications with but we all also know there’s a lot more to running a serious Website than just the user interface.

PHP on the Command Line 1/2

There are back ups to be performed, log files to be analysed, data to be pruned and all those essential but mundane tasks that happen in the background. Typically, such routine administration tasks are prime targets for automation and, if you’ve spent any time with UNIX-based systems, you’ve probably run into the notion of shell scripts and cron. PHP on the Command Line 2/2. In Part 1 of this tutorial, we had a look at PHP’s command line SAPI (server API).

PHP on the Command Line 2/2

In this article, we’ll take things a step further, and see how you can hook up a command line PHP script with existing command line tools provided by your operating system. In contrast to the last article, the focus of this article will be Unix-based systems — something which can’t be avoided. To steal a quote from Linux.com’s CLI for Noobies series: NGinx sous Ubuntu. NGinx est une des alternative au serveur Web Apache (il est actuellement utilisé par plus de 6% des serveurs Web).

NGinx sous Ubuntu

Il se targue d'être plus rapide, plus léger et facile à configurer. Nous allons vérifier tout cela dans ce billet en détaillant une installation de NGinx 0.8.54 (Stable) sur une machine GNU/Linux (Ubuntu Desktop 10.10) avec en bonus le support FastCGI de PHP et de Perl ! On commence par ajouter le dépôt officiel pour la version stable: sudo add-apt-repository ppa:nginx/stablesudo aptitude update. Nginx + varnish + memcached. Je viens de passer le cap et de m'abonner à un serveur dédié chez Online.net.

nginx + varnish + memcached

Mon choix s'est porté vers une Dedibox DC. J'ai longtemps hésité avec une OVH Kimsufi 16G mais le fait que la Dedibox propose en standard deux disques fonctionnant en RAID1 à fait la différence (avec l'âge ou privilégie la sécurité à la performance...). Nginx+PHP-FPM On Ubuntu 11.10. Version 1.0 Author: Falko Timme <ft [at] falkotimme [dot] com> Follow me on Twitter Last edited 10/20/2011 Nginx (pronounced "engine x") is a free, open-source, high-performance HTTP server.

Nginx+PHP-FPM On Ubuntu 11.10