News Feed
Sections




News Archive
feed this:

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

Hannes Magnusson:
I have a dream
May 26, 2014 @ 09:23:54

In his latest post Hannes Magnusson describes his "dream" about a future for PHP where things like upgrading and working with extensions would be simpler, faster and more manageable.

Today we will revolutionize PHP. We will make it easier to upgrade the things you care about. We will make it easier to not upgrade things you don't want to upgrade. We will make it easier to distribute your extensions. We will make it easier to release according to your own schedule. We will make it easier to add functionality. We will make it easier to work. Ok, today is a white lie here maybe... I haven't actually implemented this, but bare with me here for a second.

With the introduction and huge growth of Composer, the PEAR package manager is fading in popularity and is slowly being abandoned. Unfortunately, it's still the primary mechanism for deploying and installing PHP extensions (PECL packages). He talks about some of his recent experience reviving a package and issues he had around the use of the packaging manager. He proposes the creation of a new "pecl install" tool - a package manager dedicated to PHP extensions, decoupled from PEAR.

The manager would just install basic PHP then leave it up to you to pick which features you need from there. The idea is still in its early stages, but the idea has taken roots and plans are being worked through to see if this idea will work for the future of the language.

0 comments voice your opinion now!
pear pecl future language package manager extension

Link: http://bjori.blogspot.com/2014/05/i-have-dream.html

Mikko Koppanen:
Memcached protocol support
November 15, 2013 @ 11:15:38

Mikko Koppanen has posted about some updates he's making to the PECL memcached extension, more specifically around binary protocol support.

There are quite a few things still missing and only binary protocol is supported at the moment, but the code seems to work reasonably well in small-scale testing. I am not sure whether this is useful for anyone, but at least it allows things such as quick prototyping of network servers, exposing sqlite database over memcached protocol etc.

An example of code using this new functionality is included in the post showing how to create both a simple sever with attached "get" and "set" handlers and a client to connect to it and enable the binary protocol.

The code is still work in progress but it's available in github: https://github.com/mkoppanen/php-memcached/tree/feature-server. Note that you need to compile libmemcached with -enable-libmemcachedprotocol and the PECL memcached extension with -enable-memcached-protocol.
0 comments voice your opinion now!
memcached binary support protocol pecl update

Link: http://valokuva.org/memcached-protocol-support/

Rob Allen:
Setting up PHP & MySQL on OS X Mavericks
November 04, 2013 @ 09:52:25

For those that have made the switch to OSX Mavericks and are wondering how to get PHP and MySQL into a working state, Rob Allen has posted a quick guide to getting it all set up.

With OS X 10.9 Mavericks, Apple chose to ship PHP 5.4.17. This is how to set it up from a clean install of Mavericks. Note: If you don't want to use the built-in PHP or want to use version 5.5, then these are [other] alternatives: a binary package from Liip, Zend Server and a Homebrew install.

He provides all the commands you'll need to get things up and running including checking file/directory permissions, installing MySQL and using the command line to work with Apache (no more "Web Sharing"). He also includes the configuration changes to be made to the php.ini including how to enable Xdebug. There's lots of other good things included in the guide as well like setting up Composer, PHPUnit and how to compile a few handy extensions.

0 comments voice your opinion now!
osx mavericks mysql install configure apache extension pear pecl phpunit

Link: http://akrabat.com/computing/setting-up-php-mysql-on-os-x-mavericks/

Hasin Hayder:
Installing gearmand, libgearman & pecl gearman for php from source in Debian 6 & 7
October 31, 2013 @ 11:55:51

Hasin Hayder has posted a complete guide to getting Gearman and PHP playing nicely together. The guide gives you a step by step (and command by command) list to follow so you don't have the same pains he did trying to get it working.

I had a pretty rough evening today. No, not because the waiter forgot to add sugar in my tea, but because it was so boring to go through the trial and errors of installing gearman daemon and pecl gearman extension for php.

He walks though the whole process, starting with the failures, that he took getting it installed. Unfortunately it wasn't just as easy as installing a package and using PECL to drop in the extension. There was other software packages that needed to be installed as well and were a bit harder to figure out - libboost, gperf, libevent, uuid-dev and libcloog-ppl-dev. With these installed, the PECL install command was finally able to build and he got the shared module he needed.

0 comments voice your opinion now!
install guide gearman gearmand pecl debian source extension

Link: http://hasin.me/2013/10/30/installing-gearmand-libgearman-and-pecl-gearman-from-source/

Scott Arciszewski:
Using scrypt in PHP-based Websites
October 30, 2013 @ 10:48:18

Scott Arciszewski has posted a new tutorial to his site helping you get scrypt installed as an alternative to some of the other cryptographic functionality that's already supported by PHP (like bcrypt).

Most newbie PHP developers suck at developing user authentication systems. When not storing passwords in plaintext, they just wing it with a simple hash function and hope it's good enough. Instead of md5(), sha1(), or hash(), you should consider using scrypt, pbkdf2, or bcrypt. Today, I'll go through the steps required to start using scrypt in your web applications.

He walks you through the exact steps you'll need to get scrypt installed and working happily with PHP (provided you have root on the machine). Thankfully, it's pretty easy thanks to the scrypt extension provided through PECL. He gives a brief introduction to using the scrypt function and links to an updated version of a scrypt wrapper you can use in your applications.

0 comments voice your opinion now!
scrypt cryptography hashing extension pecl tutorial

Link: https://s.arciszewski.me/blog/2013/10/php-scrypt-setup

Mohammad Emran Hasan:
Concurrent HTTP requests in PHP using pecl_http
October 07, 2013 @ 10:42:09

Mohammad Emran Hasan has posted a quick example of using the pecl_http extension to make concurrent HTTP requests.

The pecl_http extension has a little gem that can be handy at times - HttpRequestPool. Using this, you can send concurrent HTTP requests and can gain efficiency in fetching non-related data at once. For example, from an external source if your application needs to retrieve an user's profile, their order history and current balance, you can send parallel requests to the API and get everything together.

His code shows three example connections to a made up URL on three different endpoints. With the HttpRequestPool functionality, all three can be requested at once and tracked to extract the response body.

0 comments voice your opinion now!
concurrent http request httprequestpool pecl peclhttp extension

Link: http://emranhasan.com/2013/09/concurrent-requests-in-php-using-pecl_http/

Community News:
Default JSON Support Licensing Issues in PHP
August 21, 2013 @ 11:13:57

Despite the misleading title, this post on Reddit talks some about a switch that some Linux distributions are making when it comes to JSON support in PHP. They're moving away from the built-in support in favor of including this one.

In a quote from Nikita Popov (a comment on the post) he notes that:

It is true that some Linux distribution switched from json to json-c, but this should be transparent to the user. The standard PHP distribution still ships the JSON extension as it always did. [...] You should all take this chance to switch to PHP 5.5, so you can see that everything works fine and that PHP 5.5 is awesome

He also includes comments from the Remi (Fedora) project about the switch, noting that the end user shouldn't notice any kind of issues. The reasoning behind the switch has to do with licensing and usage issues of the previously built-in extension. You can find out more about that issue in this bug report.

0 comments voice your opinion now!
json extension license pecl jsonc distribution linux

Link: http://www.reddit.com/r/PHP/comments/1ksnzw/php_json_removed_in_php_55

The PHP.cc:
PHP 5.5 Out-of-the-Box Bytecode Cache
June 25, 2013 @ 09:04:14

In a new post to their site, the PHP.cc (well, Sebastian Bergmann) takes a look at the bytecode caching feature that's included in the latest release of PHP, version 5.5.

PHP is an interpreted language. The default PHP runtime, the one that can be obtained from php.net, compiles PHP sourcecode to an intermediate representation called PHP bytecode which is then executed. A bytecode cache stores this compiled representation of PHP sourcecode in shared memory. This eliminates the need to load and compile sourcecode on each request which leads to a significant increase in performance (up to 70% more requests per second).

He looks some at "the past" of PHP and how it made it up from the world of PHP 4.x to PHP 5.4 and the de-facto bytecode cache before now, APC. With the introduction of PHP 5.5, though, developers have access to an integrated version of the ZendOptimizer+ cache built right into the language. They include a little bit of documentation about how to enable it and how to install it via PECL if it's not already built in.

0 comments voice your opinion now!
bytecode cache zendoptimizer language included pecl

Link: http://thephp.cc/viewpoints/blog/2013/06/php-5-5-out-of-the-box-bytecode-cache

Brandon Savage:
Queuing with RabbitMQ and PHP
May 28, 2013 @ 09:41:39

Brandon Savage has posted a quick overview of working with PHP and RabbitMQ for queuing. This is the first part of a three-part series about using these two technologies together effectively.

There are many times that you want to write background processes and queue up the tasks so that they can be handled in sequential order. There are any number of queues available for software developers, and one that I've really taken a liking to is RabbitMQ. Besides the fact that the queue is designed to requeue messages that are unsuccessfully delivered, RabbitMQ is fast and efficient.

He introduces some of the basic concepts behind working with RabbitMQ (like connections and channels) and an "exchange" - the method by which messages are routed. He talks about pushing messages to the exchange to be handled and how you consume the queue for updates. He also links to the various things you'll need to install to start combining these two tools including the AMPQ PECL extension.

0 comments voice your opinion now!
queue rabbitmq ampq pecl install overview series

Link: http://www.brandonsavage.net/queuing-with-rabbitmq-and-php

Chris Jones:
Using PHP 5.5's New "Opcache" Opcode Cache
March 18, 2013 @ 09:42:55

Chris Jones has a new post to his Oracle blog today talking about the new "opcode" opcode caching that's going to be built into future PHP versions This is the implementation of the Zend Optimizer+ opcode caching in a native language interface. The latest PHP 5.5 snapshots have it included.

The new "opcache" can be seen as substitute for the venerable APC cache, the maintenance of which had become an issue. Note: although opcache is now readily available, there is currently nothing preventing you from using any available (working!) opcode cache in PHP 5.5.

He gives you a quick guide to getting this new opcode caching enabled and compiled into a shiny new download of the PHP 5.5.x branch. You'll need a special command line flag on the compile and to update your php.ini to load the needed shares module. You can also use it if you're on PHP 5.2 or higher either by compiling this source or using this PECL extension.

0 comments voice your opinion now!
opcode cache zendoptimizer install configure phpini pecl



Community Events





Don't see your event here?
Let us know!


language community code podcast api bugfix application series threedevsandamaybe laravel list release framework introduction developer wordpress install library configure interview

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework