Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Johannes Schlüter's Blog:
Testing persistent connection and thread-safety features in PHP
Mar 22, 2012 @ 14:51:58

In this recent post to his blog Johannes Schlüter he talks about a way that he's come up with to test functionality that uses persistent connections (and an module he created to help).

In a few rare cases this is not what people like, for that PHP introduced "persistent connections" of different kinds. Testing those is a bit annoying as you have to configure a webserver and ensure to hit the same instance over the course of a test and then use a load generator, probably one which can detect a failure. Additionally by having a webserver in the game there is more code being executed, which might mean an additional source for trouble while debugging. An alternative might be using FastCGI, while that adds it's own issues for such a test. To solve this for myself I, some time ago, wrote a PHP SAPI module called pconn and pushed it to github.

The extension provides a way to emulate requests by executing a script multiple times automatically, making it easier to test things that require checking against multiple things simultaneously. While the built-in webserver (PHP 5.4) can be used to test some of these things too, Johannes' extension can also be compiled to help with testing of threading in applications as well.

tagged: testing persistent threat safe extension sapi module webserver

Link:

Facebook.com:
PHPEmbed
Oct 23, 2007 @ 15:27:00

Facebook application developers who already know PHP can be happy about a recent announcement on their blog - the introduction of PHPEmbed library into their setup (as well as a release of it out to the public).

In order to make embedding PHP truly simple for all of our developers we developed the PHPEmbed library which is just a more accessible and simplified API built on top of the PHP SAPI. The library is so useful, we decided to share it with the world. Check it out for yourself at http://developers.facebook.com/phpembed/

The library (currently in release 20070924) can be grabbed either directly from their download link or via the public svn repository they've set up. There's also some documentation and help for it in the form of a developer's group and the manual (PDF/HTML).

tagged: phpembed facebook sapi embed library project phpembed facebook sapi embed library project

Link:

Facebook.com:
PHPEmbed
Oct 23, 2007 @ 15:27:00

Facebook application developers who already know PHP can be happy about a recent announcement on their blog - the introduction of PHPEmbed library into their setup (as well as a release of it out to the public).

In order to make embedding PHP truly simple for all of our developers we developed the PHPEmbed library which is just a more accessible and simplified API built on top of the PHP SAPI. The library is so useful, we decided to share it with the world. Check it out for yourself at http://developers.facebook.com/phpembed/

The library (currently in release 20070924) can be grabbed either directly from their download link or via the public svn repository they've set up. There's also some documentation and help for it in the form of a developer's group and the manual (PDF/HTML).

tagged: phpembed facebook sapi embed library project phpembed facebook sapi embed library project

Link:

Pierre-Alain Joye's Blog:
Windows fixes release for Zip, fopen(,"rb") may not be binary safe
Nov 28, 2006 @ 13:13:09

A new release of the Zip PECL package has been made according to this post on Pierre-Alain Joye's blog today. The main update in this release is to counteract a Windows bug that's interfering with binary file opens.

The issue is actually a windows bug. No matter if I give or not the "b" flag to fopen, the write operations are not binary safe. It seems to be a known issue as many projects use the same trick.

The problem comes up when PHP forces the binary mode in SAPI and CLI, making the binary writes to a file non-binary safe no matter what. Pierre is also asking for help from anyone out there with any information/bug reports/references about this issue that would yield something useful.

tagged: fopen binary safe windows force mode bug sapi cli fopen binary safe windows force mode bug sapi cli

Link:

Pierre-Alain Joye's Blog:
Windows fixes release for Zip, fopen(,"rb") may not be binary safe
Nov 28, 2006 @ 13:13:09

A new release of the Zip PECL package has been made according to this post on Pierre-Alain Joye's blog today. The main update in this release is to counteract a Windows bug that's interfering with binary file opens.

The issue is actually a windows bug. No matter if I give or not the "b" flag to fopen, the write operations are not binary safe. It seems to be a known issue as many projects use the same trick.

The problem comes up when PHP forces the binary mode in SAPI and CLI, making the binary writes to a file non-binary safe no matter what. Pierre is also asking for help from anyone out there with any information/bug reports/references about this issue that would yield something useful.

tagged: fopen binary safe windows force mode bug sapi cli fopen binary safe windows force mode bug sapi cli

Link:

Alexey Zakhlestin's Blog:
FastCGI in PHP - The way it could be.
Jun 11, 2006 @ 18:26:04

Alexey Zakhlestin shares with us in this new blog post, how the fast-cgi PHP developers think they're using isn't really a true FastCGI.

Most PHP programmers believe, that PHP has support for FastCGI. They refer to fastcgi-sapi, which is bundled with php since long ago, and which was recently reimplemented for PHP 5.1.3/4. This SAPI really does exist and actually working quite good. But… it is not a real fast-cgi. It is just an imitation of mod_php which is linked against fastcgi api, instead of apache api. So, it's time for you to ask: if it exists and works, then what am I talking here about? Let's start from the basics...

He talks about a history of how things go to where they are, starting back with regular CGI scripts, moving up through using server-based APIs, and finally to FastcGI, a method for overcoming a lot of the limitations of its predecessors.

With that look back, he turns his attention around and looks to the current situation within PHP. He talks about the sudden appearance fastcgi made in PHP's SAPIs, but that the implementation wasn't true. He suggests that the reasoning behind this "fake" implementation was for the sake of speed. He also notes, however, it's his opinion that true FastCGI support in PHP will be a requirement for future large-scale applications.

tagged: fastcgi sapi fake implementation fastcgi sapi fake implementation

Link:

Alexey Zakhlestin's Blog:
FastCGI in PHP - The way it could be.
Jun 11, 2006 @ 18:26:04

Alexey Zakhlestin shares with us in this new blog post, how the fast-cgi PHP developers think they're using isn't really a true FastCGI.

Most PHP programmers believe, that PHP has support for FastCGI. They refer to fastcgi-sapi, which is bundled with php since long ago, and which was recently reimplemented for PHP 5.1.3/4. This SAPI really does exist and actually working quite good. But… it is not a real fast-cgi. It is just an imitation of mod_php which is linked against fastcgi api, instead of apache api. So, it's time for you to ask: if it exists and works, then what am I talking here about? Let's start from the basics...

He talks about a history of how things go to where they are, starting back with regular CGI scripts, moving up through using server-based APIs, and finally to FastcGI, a method for overcoming a lot of the limitations of its predecessors.

With that look back, he turns his attention around and looks to the current situation within PHP. He talks about the sudden appearance fastcgi made in PHP's SAPIs, but that the implementation wasn't true. He suggests that the reasoning behind this "fake" implementation was for the sake of speed. He also notes, however, it's his opinion that true FastCGI support in PHP will be a requirement for future large-scale applications.

tagged: fastcgi sapi fake implementation fastcgi sapi fake implementation

Link:


Trending Topics: