BLOG HOME -  UK WEB HOSTING -  PHP MYSQL HOSTING -  RESELLER HOSTING -  eUKhost FORUMS -  VPS HOSTING

Archive for PHP Web Hosting

PEAR - PHP Extension and Application Repository

PEAR - PHP Extension and Application Repository is a framework and distribution system for reusable PHP components. The purpose of PEAR is to provide a structured library of open-sourced code & a system for code distribution and package maintenance for PHP users.

The code in PEAR is partitioned in “packages”. Each package is a separate project with its own development team, version number, release cycle, documentation and a defined relation to other packages (including dependencies). Packages are distributed as gzipped tar files with a description file inside, and installed on your local system using the PEAR installer. All PEAR packages are registered in and uploaded to a central database available at pear.php.net. Open-sourced third-party packages may also be registered and uploaded. Closed-source packages may be installed by the PEAR installer, but the PEAR database is for open-source code only.

PECL
PECL (pronounced “pickle”) used to be a sub-repository of PEAR for C extensions “à la” those distributed with PHP 4, in fact, having somewhere to move extensions to from PHP was one of the motivations when creating PECL. Extensions in PECL follow PHP’s coding standards rather than PEAR’s, but they are distributed and installed as PEAR packages.

Gtk
Gtk packages are packages that provide software which uses the technology of the PHP-GTK project. Code in this sub-repository follows PEAR’s coding standards.

Comments Bookmark on del.icio.us

Pear Package Information: Caching & Console

Cache: Framework for caching of arbitrary data.
With the PEAR Cache you can cache the result of certain function calls, as well as the output of a whole script run or share data between applications.

Cache_Lite: Fast and Safe little cache system
This package is a little cache system optimized for file containers. It is fast and safe (because it uses file locking and/or anti-corruption tests).

Console_Color: This Class allows you to easily use ANSI console colors in your application.
You can use Console_Color::convert to transform colorcodes like %r into ANSI control codes. print Console_Color::convert(”%rHello World!%n”); would print “Hello World” in red, for example.

Console_Getargs: A command-line arguments parser
The Console_Getargs package implements a Command Line arguments and parameters parser for your CLI applications. It performs some basic arguments validation and automatically creates a formatted help text, based on the given configuration.

Console_Getopt: Command-line option parser
This is a PHP implementation of “getopt” supporting both short and long options.

Console_ProgressBar: This class provides you with an easy-to-use interface to progress bars.
The class allows you to display progress bars in your terminal. You can use this for displaying the status of downloads or other tasks that take some time.

Console_Table: Class that makes it easy to build console style tables
Provides methods such as addRow(), insertRow(), addCol() etc. to build console tables with or without headers.

System_Command: PEAR::System_Command is a commandline execution interface.
Running functions from the commandline can be risky if the proper precautions are not taken to escape the shell arguments and reaping the exit status properly. This class provides a formal interface to both, so that you can run a system command as comfortably as you would run a php function, with full pear error handling as results on failure.

Comments Bookmark on del.icio.us

Pear Package Information: Authentication

Auth: Creating an authentication system.
The PEAR::Auth package provides methods for creating an authentication
system using PHP.

Auth_HTTP: HTTP authentication
The PEAR::Auth_HTTP class provides methods for creating an HTTP
authentication system using PHP, that is similar to Apache’s
realm-based .htaccess authentication.

Auth_PrefManager: Preferences management class
Preference Manager is a class to handle user preferences in a web application, looking them up in a table using a combination of their userid, and the preference name to get a value, and (optionally) returning a default value for the preference if no value could be found for that user.

Auth_PrefManager2: Preferences management class
Auth_PrefManager2 supports data containers to allow reading/writing with different sources, currently PEAR DB and a simple array based container are supported, although support is planned for an LDAP container as well. If you don’t need support for different sources, or setting preferences for multiple applications you should probably use Auth_PrefManager instead.

Auth_RADIUS: Wrapper Classes for the RADIUS PECL
This package provides wrapper-classes for the RADIUS PECL.

Auth_SASL: Abstraction of various SASL mechanism responses
Provides code to generate responses to common SASL mechanisms.

LiveUser: User authentication and permission management framework
LiveUser is a set of classes for dealing with user authentication
and permission management. Basically, there are three main elements that
make up this package:
* The LiveUser class
* The Auth containers
* The Perm containers

LiveUser_Admin:
User authentication and permission management framework
LiveUser_Admin is meant to be used with the LiveUser package.
It is composed of all the classes necessary to administrate
data used by LiveUser.

Comments Bookmark on del.icio.us

PHP safe_mode

The PHP safe mode is an attempt to solve the shared-server security problem. When safe_mode is on, PHP checks to see if the owner of the current script matches the owner of the file to be operated on by a file function or its directory.

It is necessary that PHP safe_mode is On by default on a Server running in a shared environment. There are many scripts which are not compatible with safe_mode On need it Off. Following guide will show you PHP safe_mode customization.

After installing & compiling PHP with Apache we have to enable PHP safe_mode. To activate safe_mode globally on the server:

1) Find the path for PHP configuration file .i.e. ‘php.ini

# php -i | grep php.ini

The above commaned will shoe the location of php.ini, it generally located at /usr/local/Zend/etc/php.ini.

2) Edit the php.ini file.

vi /usr/local/Zend/etc/php.ini

3) Search for line safe_mode.

4) Enable safe_mode set it to On.

safe_mode = On

5) Save the file & restart apache service.

Enable/disable safe_mode for a particular account.

PHP safe_mode can be enabled/disabled for a particular account by adding the php value in the .htaccess file of the particular account.

php_flag safe_mode On OR php_value safe_mode On

Many times due PHPSuExec enabled on the server, adding php value to the .htaccess file of the account give Internal Server Error on the site. The following steps will show you how to use Apache configuration file ‘httpd.conf’ to enable/disable safe_mode.
Using PHP as an Apache module, the configuration settings can be changed using Apache configuration file ‘httpd.conf’.

1) Once your SSH to your server as root, go the httpd.conf file which is generally located at /usr/local/apache/conf or its symlink /etc/httpd/conf.

2) Open the httpd.conf file in an editor.

vi /usr/local/apache/conf/httpd.conf

3) Find the VirtualHost entry of the domain for which you have to enable/disable safe_mode. The VirtualHost entry will look like:

ServerAlias www.eukhost.com eukhost.com
ServerAdmin webmaster@eukhost.com
DocumentRoot /home/euk/public_html
BytesLog domlogs/eukhost.com-bytes_log
ServerName www.eukhost.com
User euk
Group euk
CustomLog domlogs/eukhost.com combined
ScriptAlias /cgi-bin/ /home/euk/public_html/cgi-bin/

4) Add these line:

php_admin_flag safe_mode Off

OR

php_admin_flag safe_mode 0

5) After adding the above line, the VirtualHost entry will look like:

ServerAlias www.eukhost.com eukhost.com
ServerAdmin webmaster@eukhost.com
DocumentRoot /home/euk/public_html
BytesLog domlogs/eukhost.com-bytes_log
ServerName www.eukhost.com

php_admin_flag safe_mode Off

User euk
Group euk
CustomLog domlogs/eukhost.com combined
ScriptAlias /cgi-bin/ /home/euk/public_html/cgi-bin/

6) Save the file & restart apache.

Comments Bookmark on del.icio.us

Web Cache

Web Caches are used to reduce latency & network trafiic. Web Cache saves copies of the responses such as the HTML & PHP pages, images or files which are browsed through web browser. When ever there is another request for the same file or the same url, the saved copy of the response is used instead of asking the web server for it. Web Cache sits between web servers and a client and watches requests come by, saving copies of the responses.

Using Web Cache reduces latency as the requested file or url is served from the cache instead from the web server. This reduces the time which makes the Web more responsive. Web cache also reduces the tarffic which reduces the bandwidth consumption. This surely makes the web hosting in uk cost effective.

Comments (1) Bookmark on del.icio.us

ImageMagick

ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that can be freely used, copied, modified and distributed. Its license is compatible with the GPL. It runs on all major operating systems. The functionality of ImageMagick is typically utilized from the command line or the features can be used from programs written in any programming language.

ImageMagick, version 6.2.9, is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (about 100) including GIF, JPEG, JPEG-2000, PNG, PDF, PhotoCD, TIFF, and DPX. ImageMagick can be use to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.

Features:

  • Format conversion: convert an image from one format to another (e.g. PNG to JPEG).
  • Transform: resize, rotate, crop, flip or trim an image.
  • Transparency: render portions of an image invisible.
  • Draw: add shapes or text to an image.
  • Decorate: add a border or frame to an image.
  • Special effects: blur, sharpen, threshold, or tint an image.
  • Text & comments: insert descriptive or artistic text in an image.
  • Image identification: describe the format and attributes of an image.
  • Animation: create a GIF animation sequence from a group of images.
  • Composite: overlap one image over another.

Site: http://www.imagemagick.org

Comments Bookmark on del.icio.us

« Previous entries · Next entries »