Bookmarks, Code Snippets

Change PHP settings with Apache directives

2012/01/02 | Permalink | Comment?

Suppose you have to change some PHP settings for specific projects or directories. Well, you can do so using four useful Apache directives, directly in your Apache configuration files, or even in .htaccess files. To change the value of a boolean directive use the following Apache directive:

php_flag [directive_name] on|off

To set the value of a non-boolean directive you can use the following Apache directive:

php_value [directive_name] [value]

Last, you can also use the two following directives, which behaves like the previous two directives, respectively, with a small difference. When you set a value using these directives, you can’t override it in the .htaccess file. And obviously, you can’t use them in that file.

php_admin_flag [directive_name] on|off
php_admin_value [directive_name] [value]

For example, if you want to alter the error reporting rules for a specific virtual host, just use something like this in the virtual host configuration:

php_flag display_errors on
# Equal to "E_ALL | E_DEPRECATED"
php_value error_reporting 30719

Finally, remember that you cannot use the various PHP constants. You must use the numerical codes in place of them. E.g. E_DEPRECATED is 8192. Note that you can’t add comments in the same line of the directive: put it before or after! Otherwise Apache will not start up!
For computing the value of the combination of two or more constants (like in the example above), you can use a PHP script like the following one:

<?php

echo (E_ALL | E_DEPRECATED); # Prints 30719

Enjoy!

Share and Enjoy:
  • Tumblr
  • Twitter
  • FriendFeed
  • Digg
  • StumbleUpon
  • del.icio.us
  • Technorati
  • Sphinn
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • RSS
Tags: , , , ,

Bookmarks

Webcam snapshots with jQuery

2011/11/30 | Permalink | Comment?

Have you ever thought about how can you take a picture from a user’s webcam? Here is a simple plugin for jQuery, which lets you control the webcam through javascript, and requires only that you place a small flash object in the web page.

Via xarg.org

Share and Enjoy:
  • Tumblr
  • Twitter
  • FriendFeed
  • Digg
  • StumbleUpon
  • del.icio.us
  • Technorati
  • Sphinn
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • RSS
Tags: , , ,

Bookmarks

How to fix missing shortcut icons in VS 2010 setup projects

2011/09/21 | Permalink | Comment?

Several developers are having problems with the creation of shortcuts pointing to the application in Setup Projects created using Visual Studio 2010. Shortcuts are created the same way of VS 2008, but the problem with VS 2010 is a bug  with icons management. Even if you set an icon (either a .ico or a .exe file) for the shortcut, the installer creates a shortcut with an ugly icon that looks like a blank document. This same icon is used also in the add/remove panel. (more…)

Share and Enjoy:
  • Tumblr
  • Twitter
  • FriendFeed
  • Digg
  • StumbleUpon
  • del.icio.us
  • Technorati
  • Sphinn
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • RSS
Tags: , , , , , , , ,

Bookmarks

Version Control Systems: Centralized or Distributed?

2011/01/31 | Permalink | Comment?

Distributed vs Centralized Version Control System

Version control is one of the main aspects of a good software project. When choosing one of the Version Control Systems (VCS) on the market, one should consider the benefit of using a distributed system (like Git, Bitkeeper or Mercurial) instead of a centralized one (SVN or CVS). This articles outlines pros and cons of both architectures.

via: Intro to Distributed Version Control (Illustrated)

Share and Enjoy:
  • Tumblr
  • Twitter
  • FriendFeed
  • Digg
  • StumbleUpon
  • del.icio.us
  • Technorati
  • Sphinn
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • RSS
Tags: , , , , ,

Bookmarks

Web prototyping: choose the right tool!

2010/10/31 | Permalink | Comment?

Prototyping with a skecth

The developing of a brand-new web site, or its redesign, always starts with a prototype of the graphic. And because a picture is worth a thousand words, is always more useful to sketch the site interface than describing it in a document.

But what is the right tool to choose, when building a prototype? Well, it depends on the problem, and on the status of the project. A single prototype will never be sufficient for the customer to understand how the site will be: for each phase of the project design, there’s an appropriate tool. This article explains them all!

via Match the Tool to the Problem – 52 Weeks of UX.

Share and Enjoy:
  • Tumblr
  • Twitter
  • FriendFeed
  • Digg
  • StumbleUpon
  • del.icio.us
  • Technorati
  • Sphinn
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • RSS
Tags: , , , ,

Bookmarks

CouchDB, a restful DB for JSON documents: PHP how-to.

2010/09/10 | Permalink | Comment?

CouchDB

Apache CouchDB is a free and open source document-oriented DBMS which can be queried through the standard REST operations (those of HTTP). Instead of relying on a set of tables with a fixed structure, it uses the documents as storage units. These documents are natively served as JSON key-value pairs, in a fully web style.

CouchDB is specialized for hadling very large databases which can be natively distributed and replicated over several servers. Its RESTful API allows to query the databases from all languages, and even from a simple web browser, or a command line. This tutorial from IBM explains how to query CouchDB from PHP, employing a object-oriented wrapper.

Via CouchDB basics for PHP developers.

Share and Enjoy:
  • Tumblr
  • Twitter
  • FriendFeed
  • Digg
  • StumbleUpon
  • del.icio.us
  • Technorati
  • Sphinn
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • RSS
Tags: , , , ,

Bookmarks

Review of GUI tools for MySQL

2010/08/29 | Permalink | Comment?

MySQL

MySQL is nowadays a standard in the field of databases for the Web. But what are the best tools for MySQL database management?

If you are looking for an alternative to PHPMyAdmin or MySQL GUI Tools here is a review of 10 graphical tools, either free or commercial.

via Top 10 MySQL GUI Tools — DatabaseJournal.com.

Share and Enjoy:
  • Tumblr
  • Twitter
  • FriendFeed
  • Digg
  • StumbleUpon
  • del.icio.us
  • Technorati
  • Sphinn
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • RSS
Tags: , , ,