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

A
July 03, 2014 @ 09:35:42

Joshua Thijssen has shared his toolbox for less than $100/month that includes a complete set of development and project tools "on the cheap" but still good.

There are a lot of tools out there which can help you as a developer / self-employed contractor. And even though most of these tools are free (as in beer), I don't mind spending a certain amount of money on tools that help me do my business. So with all the tools out there, all the paid plans, the freemiums and the trial periods, what can a crispy 100 dollar bill every month buy?

His list includes hosting (ServerGrove), issue tracking (Jira), team communication (HipChat) and online storage (Dropbox). His list is made up of eight services with almost all of them having a small cost. The online collaboration (Basecamp) and hosting (from ServerGrove) are the highest costs at $20USD/month.

0 comments voice your opinion now!
toolbox onehundred hosting communication storage issuetracking automation

Link: https://www.adayinthelifeof.nl/2014/07/01/a-toolbox-for-less-than-100-month/

The Code of a Ninja:
Salt, Hash and Store Passwords Securely with Phpass
June 16, 2014 @ 11:15:37

In this post to the CodeOfANinjs.com site, they walk you through password hashing, salting and storage using the PHPAss tool from OpenWall. The post itself is a bit older, but the content still provides a good example to teach the basics.

I think the main reason why we have to hash passwords is to prevent passwords from being stolen or compromised. You see, even if someone steal your database, they will never read your actual or cleartext password. I know that some PHP frameworks or CMS already provide this functionality, but I believe that it is important for us to know how its implementation can be made.

The tutorial shows you how to use the library and how to store the result in a simple "users" table in a MySQL database. The examples hash the password given from a simple form and use prepared statements (via PDO) to save it to the database. All PHP, HTML and CSS code you'll need - including the login form that checks the username/password - is included. There's also a few screenshots showing what the resulting forms and data should look like.

0 comments voice your opinion now!
phpass tutorial hash salt password storage mysql user

Link: http://www.codeofaninja.com/2013/03/php-hash-password.html

PHPMaster.com:
Saving PHP Sessions in Redis
July 09, 2013 @ 10:53:01

On PHPMaster.com today there's a new tutorial showing you how to store your application's sessions in Redis, a key/value store known for its flexible nature and speed.

PHP's default handling of session data is probably sufficient for most applications, but sometimes a project will demand a different storage approach. Luckily, the session handling routines can be overridden either by a series of functions (in older versions of PHP) or a class with methods (in newer versions) which handle various aspects of session management. In this article we'll learn how to create a custom session handler which implements PHP's SessionHandlerInterface interface and stores the session data in a Redis database.

He talks some about the reasoning behind using something more than just the normal PHP session handling (including the flexibility it provides). He covers some of the basics of the session handling functionality and covers how the data itself is stored. Finally, he gets to the actual class - a Redis-specific handler that implements the SessionHandlerInterface interface.

0 comments voice your opinion now!
tutorial redis session storage save introduction

Link: http://phpmaster.com/saving-php-sessions-in-redis/

Zurab Davitiani:
PHP Sessions in Erlang Mnesia
July 02, 2013 @ 11:31:43

In a new post to his site Zurab Davitiani shows you how to use a PHP-to-Erlang bridge to store your sessions in Mnesia. Mnesia is a distributed, soft real-time database management system written in the Erlang programming language.

I decided one of the simplest things to do would be to create a session storage for PHP in Mnesia. But that, in doing so, I would also create an extremely simple key value store wrapper around Mnesia which would track access times.

The instructions help you get the needed software set up including mypeb, kvstore and lib360. He lists all the steps needed to get the platform up and running, complete with exact commands to execute. He does point out a few things that are missing from the setup including making kvstore easier to work with and some PHP session garbage collection.

0 comments voice your opinion now!
erlang mnesia session tutorial storage database

Link: http://unix0.wordpress.com/2013/06/22/php-sessions-in-erlang-mnesia

Sameer Borate:
Storing images into a database - resolving a contentious matter
February 21, 2013 @ 11:16:45

In this new post to his CodeDiesel site Sameer Borate looks at something that's been a controversial topic with developers (not just PHP) about storing binary data, like images, in a database instead of on the local file system.

There is much discussion and argument with no final say on the issue. In one of my recent project the same issue was raised; the client and myself discussing the benefits and drawback of storing the images into a database. The project needed storing around 50,000 images, so it was important to get the question resolved satisfactorily. After much deliberation we settled on using the file system. The major factor in the decision was that we needed the database and images decoupled as we would be having multiple databases using the same set of images.

He goes on to talk about some of the things you should consider when you're deciding if storing images in the database is the right thing for your application including:

  • The bloat that can come with storing binary data (larger database size)
  • Updating images requires two operations - updating the database and updating the cached image locally
  • Images usually serve faster when they come from the filesystem through the web server
  • BLOB (a common type for binary data storage) is variable-width and can degrade performance

You can read the rest of the reasons (and get more detail on the ones above) in the rest of the post.

0 comments voice your opinion now!
images binary data storage database benefits disadvantages


Patrick van Kouteren:
CloudVPS object store beta introduction
August 28, 2012 @ 12:52:35

Patrick van Kouteren has a new tutorial posted to his site showing you how to connect your application with an OpenStack instance (specifically the CloudVPS option) via some simple CURL commands (easily translatable into PHP).

Lately I've been playing around with the CloudVPS ObjectStore, which is currently in beta phase. This blogpost shows the options of this ObjectStore in a practical way and concludes with a summary of commands you can use yourself to interact with it and some ideas. For this post, I assume you are familiar with cURL, REST and HTTP headers.

He shows how to make the requests for:

  • Authentication
  • Working with containers
  • Adding files to a container
  • Setting access permissions
0 comments voice your opinion now!
object storage curl tutorial container file authentication


Michael Nitschinger's Blog:
Using Couchbase as a flexible session store
June 21, 2012 @ 09:24:38

Michael Nitschinger has a new post to his site today showing how to implement Couchbase as a storage mechanism for your session information (including some handy extra features).

What do I mean by flexible? Well, the combination of a highly scalable key-value store and the possibility to query your data through views allows you to gain unique insight inside your data in near realtime. [...] Let's look at some obstacles that we as application developers face and then see how we may solve them through Couchbase and its functionality.

He talks about some of the options to track user sessions (both on the server and client side) including PHP's sessions, HTML5 data storage and memcache. He covers some of the most basic session tracking needs and shows how to use the CouchBase extension to work with and setting some key/value combinations for user sessions. He shows how to query these data structures (JSON data) and filter to find only the records needed

0 comments voice your opinion now!
couchbase tutorial session storage


IBM developerWorks:
Store datasets directly in shared memory with PHP
January 20, 2012 @ 11:29:24

On the IBM developerWorks site today there's a new tutorial showing you how to store shared data directly to a shared memory space of your PHP application.

Once created, and given proper permissions, other processes in the same machine can manipulate those segments by: read, write, and delete. This means that an application written in C can share information with an application written in other languages, such as Java or PHP. They can all share information, as long as they can access and understand that information. [...] This article's proposal is simple, learn how to create and manipulate shared memory segments with PHP and use them to store datasets that other applications can use.

Your PHP installation will need to have been compiled with "enable-shmop" to work with the code in this tutorial. Their examples show how to use the shmop_open, shmop_write and other related functions to read, write, remove and close segments in the shared memory space. They also include an example of using the SimpleSHM library to make it easier to interact with the shared memory space as a standard storage location.

0 comments voice your opinion now!
shared memory shmop dataset simpleshm storage


Johannes Schlüter's Blog:
High Performance PHP Session Storage on Scale
November 18, 2011 @ 10:13:25

In this new post to his blog, Johannes Schlüter looks at a high-performance solution to the usual storing PHP session information via a memcache frontend with a MySQL Cluster backend.

Unfortunately even such a system [using MySQL and InnoDB tables] has limits and unfortunately replication is no good solution here to scale further as we will always need a master for writing the updated session data. By using replication we can take some load from it and we can configure a slave which can be promoted to master to keep session alive if the primary master machine fails but at some point in time we need another solution ... but, happy news, again: One doesn't have to look far as MySQL cluster will be happy to help. MySQL Cluster "is a high-availability, high-redundancy version of MySQL adapted for the distributed computing environment," as the MySQL documentation states.

He describes the setup (after pointing to this post about installing MySQL Cluster for memcache) and includes some sample code/SQL/ini settings you'll need to use to get PHP's memcached functionality to cooperate with it.

0 comments voice your opinion now!
performance session storage mysql cluster memcache frontend backend


Andrew Martin's Blog:
Serving PHP session files from a RAM based disk (tmpfs) for AWS Micro Instance
October 06, 2011 @ 11:42:36

Andrew Martin has a new post to his blog looking at a technique that could be used to help minimize some of the performance issues you could see on AWS micro instances dealing with PHP session handling. His alternative is serving them from a RAM-based disk instead.

It's rare to find a web server with slow disk I/O performance, but Amazon's EC2 micro-instances are one such example. Their EBS disk subsystem access is rated "low", and this can have a detrimental effect on HTTP throughput. [...] This leaves sessions, which can be written to a redundant and fault tolerant storage system. [...] In order to speed up the disk access, a RAM-based disk can be mounted over the session directory. This has the disadvantage of being volatile - the data is lost in case of a server reboot, or the mount point being unmounted. However if tolerable, storing sessions in RAM insulates the application from poor filesystem performance.

He mentions the two types of kernels that can be used, ramfs and tmpfs, and the specifics of using a tmpfs filesystem to implement the technique (complete with command line calls to make it happen).

0 comments voice your opinion now!
session files ram disk tmpfs storage performance



Community Events





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


artisanfiles voicesoftheelephpant composer community opinion introduction security laravel list podcast library framework series tool language symfony conference interview release version

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