PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. [read more at]

  • Since I am facing performance problem due to the load of visitors and a badly configured server, I decide today to document my findings in this new series of articles.

    As soon as PHP run as FastCGI and no more inside an Apache module ( is not multi threaded), You should be able to switch the default MPM setting of Apache from MPM prefork to MPM worker.

    So, what's the difference between prefork and worker?

    Quoting from the Apache MPM Prefork page:
    MPM Prefork implements a non-threaded, pre-forking web server that handles requests in a manner similar to Apache 1.3.

    And for the Apache MPM Worker says:
    MPM Worker implements a hybrid multi-process multi-threaded server. By using threads to serve requests, it is able to serve a large number of requests with less system resources than a process-based server.

    Server: Strato (
    Operating system: SuSE / openSuSE
    Requirements: root access and basic Unix knowledge

    1 Edit the file  
    # vi /etc/sysconfig/apache2

    and change the key:

    APACHE_MPM=" "



    2 You can now tune also  default parameters in file /etc/apache2/server-tuning.conf
    Here are my settings, these are still the default setting of Apache


    # worker MPM

    <IfModule worker.c>
        ServerLimit 16
        # initial number of server processes to start
        StartServers         2
        # minimum number of worker threads which are kept spare
        MinSpareThreads     25
        # maximum number of worker threads which are kept spare
        MaxSpareThreads     75
        # maximum number of simultaneous client connections
        MaxClients       150
        # constant number of worker threads in each server process
        ThreadsPerChild     25
        # maximum number of requests a server process serves
        MaxRequestsPerChild  6000

    3 start
    # apache2-reconfigure-mpm
    this recreate the file  /etc/apache2/sysconfig.d/loadmodule.conf
    and restart apache automatically. Test Your site to ensure everything still work as expected.

  • joomla_cms

    Since my server is still suffering, Ive decide today to take some actions.

    user: changes can be done on shared hosting with limited user rights.
    root. changes require a full access to the server (root access with secure shell ssh)

    I have currently per months, 160.000 visitors and 2 Millions Hits.or per day 8000 visitors and 24000 pages view.
    Server has only 1GB RAM.

    UPDATE: I found one/THE reason why my host is slowing down...SPAMMERS!

    click read more

    user: Joomla! settings
    • I switch enable gzip compression OFF. Since this is meant to reduce the usage of bandwidth, not the load on my  server. The server has to encode all the files in order to send them, which only puts additional load on your page.
    • I switch Joomla!! statistics off, as AWSTATS is providing a much better job.
    user: MySQL maintenance

    I Optimize (repair, refresh statistics) MySQL tables through MySQL admin, but It can be done through PLESK
    user: Tune Joomla!! cache

    I Increase Joomla! cache lifetime from 900seconds to 24 hours as it better reflect the way I update my site (daily)
    user: keep pages small

    • Reduce size of banner, using GIMP so they are using a web palette, most of them were shrink from 40kb to 7kb
    • I remove all un-needed space from the main templates file (index.php), an action which will help first users visitors only.
    • Attention, it is a never ending task...
    user: Hunting software bugs
    By switching the site to debug mode, I notice some nasty queries (select count(*) from), all created by my statistics module ( Content Statistics on right side), In fact Joomla!! module do not inherit from Joomla!! cache automatically. I fix value in this module since I do not want to program cache support in it right now.
    root One morecache

    I decide to install a PHP accelerator: PHPA from
    " The ionCube PHP Accelerator is an easily installed PHP Zend engine extension that provides a PHP cache, and is capable of delivering a substantial acceleration of PHP scripts without requiring any script changes, loss of dynamic content, or other application compromises."

    Install is straightforward: just copy library into /usr/local/lib/
    and add these lines to /etc/php.ini

    ; PHP Accelerator extension
    phpa = on
    phpa.c0_size = 64
    phpa.cache_dir = /tmp
    phpa.c0_logging = on

    ;The shm_stats_check_period is the minimum interval between checks of the
    ;cache for expired scripts. The first server request after the interval has
    ;elapsed will trigger a scan of the cache for expired scripts, and remove
    ;any entries that it finds.
    phpa.c0_stats_check_period = 5m

    ;The shm_ttl value is the value used to set the
    ;time-to-expiry value when a script is accessed. Put another way, the shm_ttl
    ;value is the period after which an unaccessed script expires.
    phpa.c0_ttl = 12h

    ;phpa.ignore_files = ""
    ;phpa.ignore_dirs = ""

    I use that tool: HTTP Viewer to check if my page now contains a headerX-Accelerated-By:·PHPA/1.3.3r2

    Reduce surface of attack: I found my components that were not used by Joomla! (very old code and uused components . So go through all directories with FTp/SCP and remove any un-needed code....

    Review table data directly in the database...
    This is how I found 27 000 spams in my gallery (Zoom gallery)
    • I remove all entries
    • Disallow comments operations (in Zoom gallery admin panel),
    but spammers were still able to insert comments, so I edit the file components/com_zoom/lib/image.class.php
    //add because of spammers
    header("HTTP/1.0 403 Forbidden");
    //$database->setQuery("INSERT INTO __zoom_comments (imgid,cmtname,cmtcontent,cmtdate) VALUES ('".mysql_escape_str

    Note: I  recommend You to use also mod_evasive and mod_security  (root access needed), see aprevious article on my site

    Some links, where I borrow some ideas:,50278.0.html,54175.0.html
  • This small plugin for Joomla! add a message inviting iPhone/iPad users to add the web application to the home screen.

    The code is compatible with iPhone/iPod touch, iPhone4 and iPad. On older devices the “add” icon is a “+” while on iOS 4.2 it has been replaced with . The script detects the OS version and displays the appropriate icon.

    The message appears after 2 seconds (customizable) from page load, and is destroyed after 20 seconds (also customizable). The balloon enters and exits the screen with a quick configurable animation: drop from top, bubble from bottom or fade in/out. Additionally it also let you choose a custom icon for your blog when a visitor adds your website to start screen.

    What’s new

    • New version for Joomla 2.5 / 1.5
    • New javascript engine&160; in version 2.0,
    • New CSS,
    • Add support for returningVisitor: show the message to returning visitors only. Set this to true and the message won’t be shown the first time an user visits your site. Default: false,
    • Add support for autostart: should the balloon be automatically initiated? Default: true.
    • BUG: avoid duplicate javascript insertion now using onAfterDispatch() instead of onAfterInitialise
    • BUG: now touchIcon is properly inserted in message
    • Add support for custom iconMessage,
    • add support status-bar styling:
      Sets the style of the status bar for a web application.
      This meta tag has no effect unless you first specify full-screen mode as described in “apple-mobile-web-app-capable.”
      If content is set to default, the status bar appears normal. If set to black, the status bar has a black background. If set to black-translucent, the status bar is black and translucent. If set to default or black, the web content is displayed below the status bar. If set to black-translucent, the web content is displayed on the entire screen, partially obscured by the status bar. The default value is default.

    Full list of changes available in GIT commit e1e375cc44d594236db2a84702bad6f426ce99b6


    add2Home_ipod_iphone_ipad_joomla_001 add2Home_ipod_iphone_ipad_joomla_002

    This plugin is based on the project add2Home (MIT license) and all credits goes to the author Matteo Spinelli

    You can see a demo of it at and it is currently active on this blog.

    You can create your own Apple icon using free online service like

  • This small plugin for Joomla! add a message inviting iPhone/iPad users to add the web application to the home screen.

    Add2Home has been updated to version 1.6.4 correct 2 bugs and contains an important new feature for both Joomla 1.7 and Joomla 2.5. For existing users the update will display in the Extensions Manager under Updates. If you do not have this currently installed, you can click the link below and install as normal via the Extensions Manager.

    New ideas/features/bugs are always welcomed either through forums or&160; by using feedback

    Some early report show that on add2Home work on iPhone/iPad/iPod running iOS 5.01 The close button doesn´t work on IOS 5.1. It seems to have something to do with iOS versions. I am on it

    What’s new?

  • NEW: Add new setting “webapp-links" Using this will rewrite all your internal Joomla links and make your entire site appear to be working outside of safari as a web application!.
  • NEW: Installation branding,
  • BUG: new update site in installer
  • BUG:duplicate initialization of javascript
  • NEW: Frequently Asked Questions started in wiki

    Full list of changes available in GIT commit 329d0a3765d5b86af49377dfbb04a0317b94fcc7 and 2131a2e3e6a51b4d6f54e790dc7a961650cce7b5

  • MediaWiki-logo I search and search on how to add a Google analytics to MediaWiki, seems pretty damn simple as long as you know which templates you are using as default.

    The current skins is configured in LocalSettings.php

    ## Default skin: you can change the default skin. Use the internal symbolic
    ## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook':
    $wgDefaultSkin = 'monobook';

    Head to {mediawiki_root}/skins and edit&160; the right skins, for me it is MonoBook.php

    Just add your analytics scripts before the </body>. Now MediaWiki will add the marker in every page


    <?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?>
    <?php $this->html('reporttime') ?>
    <?php if ( $this->data['debug'] ): ?>
    <!-- Debug output:
    <?php $this->text( 'debug' ); ?>
    <?php endif; ?>


    <?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?>
    <?php $this->html('reporttime') ?>
    <?php if ( $this->data['debug'] ): ?>
    <!-- Debug output:
    <?php $this->text( 'debug' ); ?>
    <?php endif; ?>
    <script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost
    + "' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-88600-7"); pageTracker._trackPageview(); } catch(err) {}</script>
  • I took the time to work 3 hours on OpenComment, and I made some impressive progress...
    • I am able to understand xajax development and error messages faster now
    • Nearly all basic functions are AJAX enable: rating, admin function, publishing, sorting, filtering etc...
    • I have start to refactore the code and clean out dead and bad code,
    • I am able to use some basic Joomla library (while not being in a Joomla session).
    And in order to thank You all for Your patience, I have create a FLASH movie with WINK

    Wink is a Tutorial and Presentation creation software, primarily aimed at creating tutorials on how to use software (like a tutor for MS-Word/Excel etc). Using Wink you can capture screenshots, add explanations boxes, buttons, titles etc and generate a highly effective tutorial for your users.

    Carbon Viewlet being too expensive: 200$ right now for my usage but if someone has a licence to offer me ;-)

    The video is  here GO for OpenComment video  (a little bit rough for 300kB, but the WOW effect should be here)

    • All operation are done WITHOUT reloading the whole page,
    • This thing is lightning fast
    • The AJAX library has reduce the code of at least 30% (no more form, no submit, no code to compute redirect url etc...)
    • Dont ask for a release date, it will be ready when it is ready!
    • Adding security and reviewing code has to be done, I dont want to let hackers missuse the system.
    • The PHP code is commited to Joomla forge,
    • The PHP code is right now still joomla 1.0.9 compatible, I think I need less than a day to migrate code to Joomla 1.5 API
    • No installer or complete admin panel (70%) right now, will be done at the end.
    • Contact me if You want to help.
    more news soon....ENJOY
  • When Eclipse meet Joomla!...from 0 to Joomla! in 3 minutes


    The easiest way to develop component, modules, plugin for Joomla! using best of the breed open source software.&160;
    In order to speed up development of Joomla software, I did develop a developer package "start and ready to work". So basically nothing special for any experienced developer, just a gain of time. Less experienced developer will enjoy the package!&160; Just unpack the big ZIP file on any drive, start 2 program and you have a running Eclipse and Joomla! environment for developing

    Read more in the WIKI

    To be release in a few hours from now

    Content of package

    eclipse logo
    Eclipse 3.4
    Eclipse is an open source community whose projects are focused on providing a vendor-neutral open development platform and application frameworks for building software. The Eclipse Foundation is a not-for-profit corporation formed to advance the creation, evolution, promotion, and support of the Eclipse Platform and to cultivate both an open source community and an ecosystem of complementary products, capabilities, and services.
    PDT 2.0 The PDT project provides a PHP Development Tools framework for the Eclipse platform. This project encompasses all development components necessary to develop PHP and facilitate extensibility. It leverages the existing Web Tools Platform (WTP) and Dynamic Languages Toolkit (DLTK) in providing developers with PHP capabilities.
    XAMPP 1.7.0
    XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use - just download, extract and start.
    apache http server
    • Apache HTTPD 2.2.11 + Openssl 0.9.8i

    The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows NT. The goal of this project is to provide a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards.

    Apache has been the most popular web server on the Internet since April 1996.
    with mod_rewrite
    php logo
    • phpMyAdmin 3.1.1
    • FileZilla FTP Server 0.9.29
    • Mercury Mail Transport System 4.52
    PHP is a popular open-source programming language used primarily for developing server-side applications and dynamic web content, and more recently, other software. The name is a recursive acronym for "PHP: Hypertext Preprocessor".

    with PHPdg debugger support
    with GD2 image manipulation library
    PphpMyAdmin 3.1.1
    phpMyAdmin is a tool written in PHP intended to handle the administration of MySQL over the Web. Currently it can create and drop databases, create/drop/alter tables, delete/edit/add fields, execute any SQL statement, manage keys on fields.

    Accessible through:
    joomla logo
    Joomla 1.0.15
    Joomla! is one of the most powerful Open Source Content Management Systems on the planet. It is used all over the world for everything from simple websites to complex corporate applications. Joomla! is easy to install, simple to manage, and reliable.

    configured to access mysql dev10x database
    admin panel login: admin
    admin panel pwd: admin
    joomla logo
    Joomla 1.5.9
    configured to access mysql dev15x database
    admin panel login: admin
    admin panel pwd: admin
    mysql logo
    MySQL 5.1.30&160;
    root login: root
    root password: empty
    Eclipse Launcher Version 2.0.2 A tool for java developers using eclipse IDE. The eclipse launcher provides developers to manage multiple workspaces and to start those. The program is shown in system tray from which it is possible to edit or start the workspace definition in an easy way.
    KDK 1.6u11
    Java Development Kit from Sun Microsystems that implements the basic set of tools needed to write, test and debug Java applications and applets. Needed to run Eclipse.

    &160; MySQL Administrator is a powerful visual administration tool that makes it easy to administer and monitor your MySQL environment and gain significantly better visibility into how your databases are operating. MySQL Administrator now integrates database management and maintenance into a single, seamless environment, with a clear and intuitive graphical user interface.

    MySQL Query Browser is the easiest visual tool for creating, executing, and optimizing SQL queries for your MySQL Database Server. The MySQL Query Browser gives you a complete set of drag-and-drop tools to visually build, analyze and manage your queries.

    The MySQL Migration Toolkit is a powerful framework that enables you to quickly migrate your proprietary databases to MySQL. Using a Wizard-driven interface, the MySQL Migration Toolkit implements a proven methodology and walks you through the necessary steps to successfully complete a database migration project.

    Some figures

    • Distribution is available as zip
    • You will have to accept and Read all licenses in directory SolarJoomla\licenses\
    • start one program to enjoy a running a Joomla developer environment in no time!
  • apache

    The acronym LAMP refers to a solution stack of software, usually free and open source software, used to run dynamic Web sites or servers. It stand for:

    • Linux, for the operating system;
    • Apache, the Web server;
    • MySQL, the database management system (or database server);
    • Perl, Python, and PHP, the programming languages.

    &160;ab is a tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server. It is designed to give you an impression of how your current Apache installation performs. This especially shows you how many requests per second your Apache installation is capable of serving.
    Apache-utils package contains utility programs for webservers and some add-on programs useful for any webserver. These include:

    • ab (Apache benchmark tool)
    • Logresolve (Resolve IP addresses to hostname in logfiles)
    • htpasswd (Manipulate basic authentication files)
    • htdigest (Manipulate digest authentication files)
    • dbmmanage (Manipulate basic authentication files in DBM format, using perl)
    • htdbm (Manipulate basic authentication files in DBM format, using APR)
    • rotatelogs (Periodically stop writing to a logfile and open a new one)
    • split-logfile (Split a single log including multiple vhosts)
    • checkgid (Checks whether the caller can setgid to the specified group)
    • check_forensic (Extract mod_log_forensic output from apache log files)

    This package Apache-Utils can be install through apt or YaST depending if you are using a Debian base distro or OpenSuse


    • Define realistic objectives, do not create too much virtual clients if you do not have usually that kind of user traffic..
    • For example an objective could be: number of users served, or percentage of the requests served within a certain time
    • This tool ab do not simulate realistic user behavior, it just hit a page without being able to simulate a complex workflow (like login, navigate and do things users usually do)
    • Try to monitor at the same time the CPU/Memory consumed in order not to make false assumption on apache settings (use top d 1)


    It is an iterative process!

    1. Benchmark,
    2. Change settings and
    3. Restart benchmark.

    It is very important to only change a setting a time in order to better identify what is really bringing something! By changing only one settings at a time, you can:

    • Better see the influence on CPU, memory (you must look also at resources, a server swapping to disk is never good)
    • There is not so much universal settings bringing a speed kick (except DNSlookup off, keep alive small), some settings are depending on your Linux kernel version, CPU class, disk speed, network latency

    Other components

    mysql While tuning apache, you will see that most of the time is used in PHP/MySQL, for MySQL recommend to run at the same time, read more here


    ab [ -A auth-username:password ] [ -c concurrency ] [ -C cookie-name=value ] [ -d ] [ -e csv-file ] [ -g gnuplot-file ] [ -h ] [ -H custom-header ] [ -i ] [ -k ] [ -n requests ] [ -p POST-file ] [ -P proxy-auth-username:password ] [ -q ] [ -s ] [ -S ] [ -t timelimit ] [ -T content-type ] [ -v verbosity] [ -V ] [ -w ] [ -x <table>-attributes ] [ -X proxy[:port] ] [ -y <tr>-attributes ] [ -z <td>-attributes ] [http://]hostname[:port]/path


    -A auth-username:password
    Supply BASIC Authentication credentials to the server. The username and password are separated by a single : and sent on the wire base64 encoded. The string is sent regardless of whether the server needs it (i.e., has sent an 401 authentication needed).
    -c concurrency
    Number of multiple requests to perform at a time. Default is one request at a time.
    -C cookie-name=value
    Add a Cookie: line to the request. The argument is typically in the form of a name=value pair. This field is repeatable.
    Do not display the "percentage served within XX [ms] table". (legacy support).
    -e csv-file
    Write a Comma separated value (CSV) file which contains for each percentage (from 1% to 100%) the time (in milliseconds) it took to serve that percentage of the requests. This is usually more useful than the 'gnuplot' file; as the results are already 'binned'.
    -g gnuplot-file
    Write all measured values out as a 'gnuplot' or TSV (Tab separate values) file. This file can easily be imported into packages like Gnuplot, IDL, Mathematica, Igor or even Excel. The labels are on the first line of the file.
    Display usage information.
    -H custom-header
    Append extra headers to the request. The argument is typically in the form of a valid header line, containing a colon-separated field-value pair (i.e., "Accept-Encoding: zip/zop;8bit").
    Do HEAD requests instead of GET.
    Enable the HTTP KeepAlive feature, i.e., perform multiple requests within one HTTP session. Default is no KeepAlive.
    -n requests
    Number of requests to perform for the benchmarking session. The default is to just perform a single request which usually leads to non-representative benchmarking results.
    -p POST-file
    File containing data to POST.
    -P proxy-auth-username:password
    Supply BASIC Authentication credentials to a proxy en-route. The username and password are separated by a single : and sent on the wire base64 encoded. The string is sent regardless of whether the proxy needs it (i.e., has sent an 407 proxy authentication needed).
    When processing more than 150 requests, ab outputs a progress count on stderr every 10% or 100 requests or so. The -q flag will suppress these messages.
    When compiled in (ab -h will show you) use the SSL protected https rather than the http protocol. This feature is experimental and very rudimentary. You probably do not want to use it.
    Do not display the median and standard deviation values, nor display the warning/error messages when the average and median are more than one or two times the standard deviation apart. And default to the min/avg/max values. (legacy support).
    -t timelimit
    Maximum number of seconds to spend for benchmarking. This implies a -n 50000 internally. Use this to benchmark the server within a fixed total amount of time. Per default there is no timelimit.
    -T content-type
    Content-type header to use for POST data.
    -v verbosity
    Set verbosity level - 4 and above prints information on headers, 3 and above prints response codes (404, 200, etc.), 2 and above prints warnings and info.
    Display version number and exit.
    Print out results in HTML tables. Default table is two columns wide, with a white background.
    -x <table>-attributes
    String to use as attributes for <table>. Attributes are inserted <table here >.
    -X proxy[:port]
    Use a proxy server for the requests.
    -y <tr>-attributes
    String to use as attributes for <tr>.
    -z <td>-attributes
    String to use as attributes for <td>.

    Some real examples

    time /usr/sbin/ab2 -n 500 -c 30
    This will make 500 requests on them and hammering localhost for 30 seconds

    After tuning Before tuning
    Benchmarking www.waltercedric.comCompleted 100 requests
    Completed 200 requests
    Completed 300 requests
    Completed 400 requests
    Finished 500 requests
    Server Software:&160;&160;&160;&160;&160;&160;&160; NOYB
    Server Hostname:&160;&160;&160;&160;&160;&160;&160;
    Server Port:&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; 80
    Document Path:&160;&160;&160;&160;&160;&160;&160;&160;&160; /index.php
    Document Length:&160;&160;&160;&160;&160;&160;&160; 45532 bytes
    Concurrency Level:&160;&160;&160;&160;&160; 30
    Time taken for tests:&160;&160; 38.576375 seconds
    Complete requests:&160;&160;&160;&160;&160; 500
    Failed requests:&160;&160;&160;&160;&160;&160;&160; 19&160;
    &160;&160; (Connect: 0, Length: 19, Exceptions: 0)
    Write errors:&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; 0
    Total transferred:&160;&160;&160;&160;&160; 23000106 bytes
    HTML transferred:&160;&160;&160;&160;&160;&160; 22762106 bytes
    Requests per second:&160;&160;&160; 12.96 [#/sec] (mean)
    Time per request:&160;&160;&160;&160;&160;&160; 2314.582 [ms] (mean)
    Time per request:&160;&160;&160;&160;&160;&160; 77.153 [ms] (mean, across all concurrent requests)
    Transfer rate:&160;&160;&160;&160;&160;&160;&160;&160;&160; 582.25 [Kbytes/sec] received
    Connection Times (ms)
    &160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; min&160; mean[+/-sd] median&160;&160; max
    Connect:&160;&160;&160;&160;&160;&160;&160; 0&160;&160;&160; 8&160; 36.9&160;&160;&160;&160;&160; 0&160;&160;&160;&160; 207
    Processing:&160;&160; 394 2239 345.3&160;&160; 2237&160;&160;&160; 6223
    Waiting:&160;&160;&160;&160;&160; 379 2197 340.9&160;&160; 2190&160;&160;&160; 6173
    Total:&160;&160;&160;&160;&160;&160;&160; 397 2247 344.2&160;&160; 2239&160;&160;&160; 6223
    Percentage of the requests served within a certain time (ms)
    &160; 50%&160;&160; 2239
    &160; 66%&160;&160; 2294
    &160; 75%&160;&160; 2327
    &160; 80%&160;&160; 2357
    &160; 90%&160;&160; 2457
    &160; 95%&160;&160; 2560
    &160; 98%&160;&160; 2973
    &160; 99%&160;&160; 3341
    100%&160;&160; 6223 (longest request)
    real&160;&160;&160; 0m38.617s
    user&160;&160;&160; 0m0.024s
    sys&160;&160;&160;&160; 0m0.240s

    Completed 100 requests
    Completed 200 requests
    Completed 300 requests
    Completed 400 requests
    Finished 500 requests

    Server Software:&160;&160;&160;&160;&160;&160;&160; NOYB
    Server Hostname:&160;&160;&160;&160;&160;&160;&160;
    Server Port:&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; 80

    Document Path:&160;&160;&160;&160;&160;&160;&160;&160;&160; /index.php
    Document Length:&160;&160;&160;&160;&160;&160;&160; 45532bytes

    Concurrency Level:&160;&160;&160;&160;&160; 30
    Time taken for tests:&160;&160; 108.897481 seconds
    Complete requests:&160;&160;&160;&160;&160; 500
    Failed requests:&160;&160;&160;&160;&160;&160;&160; 19
    &160;&160; (Connect: 0, Length: 19, Exceptions: 0)
    Write errors:&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; 0
    Total transferred:&160;&160;&160;&160;&160; 23000106bytes
    HTML transferred:&160;&160;&160;&160; 23000106bytes
    Requests per second:&160;&160;&160; 4.59 [#/sec] (mean)
    Time per request:&160;&160;&160;&160;&160;&160; 6533.849 [ms] (mean)
    Time per request:&160;&160;&160;&160;&160;&160; 217.795 [ms] (mean, across all concurrent requests)
    Transfer rate:&160;&160;&160;&160;&160;&160;&160;&160;&160; 178.41 [Kbytes/sec] received

    Connection Times (ms)
    &160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; min&160; mean[+/-sd] median&160;&160; max
    Connect:&160;&160;&160;&160;&160;&160;&160; 0&160; 114 478.9&160;&160;&160;&160;&160; 0&160;&160;&160; 2276
    Processing:&160;&160; 336 6186 1665.2&160;&160; 6108&160;&160; 16189
    Waiting:&160;&160;&160; -5148 5982 1982.8&160;&160; 6066&160;&160; 16009
    Total:&160;&160;&160;&160;&160;&160;&160; 391 6301 1580.2&160;&160; 6120&160;&160; 17093

    Percentage of the requests served within a certain time (ms)
    &160; 50%&160;&160; 6120
    &160; 66%&160;&160; 6453
    &160; 75%&160;&160; 6778
    &160; 80%&160;&160; 7046
    &160; 90%&160;&160; 7861
    &160; 95%&160;&160; 8516
    &160; 98%&160; 10110
    &160; 99%&160; 12418
    100%&160; 17093 (longest request)

    real&160;&160;&160; 1m48.905s
    user&160;&160;&160; 0m0.024s
    sys&160;&160;&160;&160; 0m0.152s


    time /usr/sbin/ab2 -kc 10 -t 30
    This will open 10 connections, using Keep-Alive on them and hammering localhost for 30 seconds

    Same tests but without mod_security

    • Mod_security is a module for Apache which act like a software firewall
    • Depending on the number of rules, can greatly affect through output speed

    time /usr/sbin/ab2 -kc 10 -t 30
    This will open 10 connections, using Keep-Alive on them and hammering localhost for 30 seconds

    real&160;&160;&160; 0m39.040s
    user&160;&160;&160; 0m0.020s
    sys&160;&160;&160;&160; 0m0.208s

    Nearly one second more with mod_security gotroot rules, worth the added security!

    If you want to know more options and how to use apache ab check the apache ab/ab2 man page click here for this man page

    How to optimize Apache/Joomla/PHP

    I forward You to some of my previous articles:

    And more ideas here Secure, Safe, Fast Linux Hosting

  • cedTag

    CedTag&160; has been updated to version 2.5.3 and correct a lot of bugs and contains some nice features.

    CedTag is the continuation of the GPL component Joomla Tags (, Most of the codehas been rewritten according to the new standard of Joomla 2.5, the component has been greatly extended and most bugs have been removed. I will continue removing, refactoring existing codebase, in order to be able to add new features faster.

    What’s new

    NEW: Auto completion of tags in frontend and backend using jQuery. You can add new tags, search and remove tags without fearing creating duplicates!
    NEW: Joomla ACL support,
    NEW: Add basic support for themes, still need some css correction for optimal results
    NEW:Use confirmation popup windows for all delete/clear operations,
    NEW: New option to switch off tags title in front page,
    NEW: No white background in simple.css for people loving their black background as default,
    NEW: cedTag is now having no warnings/errors in PHP error level E_STRICT
    BUG:&160; I cant disable cedTag on front page when i disable it any thing not change...i want show tags only on full article view...
    BUG:&160; Working update manager: starting at version 2.5.3 you can update with one click in the update manager.
    BUG: Did remove a hack of me for testing -> it was not possible to switch off the add tags button in frontend since i fixcoded to true :-(
    BUG: Correct issue in editor xtd plugin blocking users to edit/view articles in frontend

    Code cleaning

    • Rewrite 90% of all query string to use the $query object api of joomla
    • Did clean the content plugin a lot,

    CedTag is used on this site with more than 5000 tags in 2200 articles.

    Your ideas are important, feel free to contact me and ask for new features!

  • cedTag4

    CedTag&160; has been updated to version 2.5.5 and correct a lot of bugs and contains some nice new features.

    CedTag is the continuation of the GPL component Joomla Tags (, Most of the code if not allhas been now rewritten according to the new standard of Joomla 2.5, the component has been greatly extended and most bugs have been removed. I will continue removing, refactoring existing codebase, in order to be able to add new features faster.

    What’s new

    NEW: Wikipedia auto-completion of tag descriptions with Wikipedia&160; OpenSearch API!

    Support more than 40 localized Wikipedia servers (all Wikipedia with more than 100’000 articles)

    العربيةБългарскиCatalàČeskyDanskDeutschEnglishEspañolEsperantoEuskaraفارسیFrançais한국어हिन्दीHrvatskiBahasa IndonesiaItalianoעבריתLietuviųMagyarBahasa MelayuNederlands日本語Norsk (bokmål)PolskiPortuguêsҚазақша / Qazaqşa / قازاقشاRomânăРусскийSlovenčinaSlovenščinaСрпски / SrpskiSuomiSvenskaTürkçeУкраїнськаTiếng ViệtVolapükWinaray中文

    For all termscedtag_wikipediaautofill1


    or while editing a term

    NEW:diagnostic page

    NEW: tags can also now be automatically inserted when new article is entered from the backend,
    NEW: new configuration settings “Force Existing articles get their tags updated always from article meta keywords at save time” under Tab Tags (default is No)

    NEW: Supporting tags containing many words separated by space: There are normally 5 ways to insert a tag after inputting some text: space, comma, enter, selecting an autocomplete option, or defocusing the widget. Now space now longer save the tag: You can enter tags with space as a result!
    NEW: inline documentation when adding tag in frontend



    BUG: Code cleaning, according to Joomla standard: my dream is to have this extension accepted in Joomla core! Still a lot of PHP Unit test to be written before submitting this to the mailing list of Joomla developers. Now I use Joomla CodeSniffer&160; and PSR-1 CodeSniffer rules in my day to day development.
    BUG:&160; after click on Template Manager it show this err Fatal error: Class 'UsersHelper' not found in /home/assafir/public_html/administrator/components/com_cedtag/views/css/view.html.php on line 41
    BUG: tags were not inserted automatically from new content article in frontend,
    BUG: it was not possible to use html descriptions
    BUG: missing some images resources

    Your ideas are important, feel free to contact me and ask for new features!

  • &160;

    cedTag provide a useful way to group related posts together and to quickly tell readers what a post is about. Tags also make it easier for people to find your content. Tags are similar to, but more specific than, Joomla categories.


    Go to the Extension Manager under the tab Manage, enter in filter "tag", select all and click Actions – Uninstall
    Reason: I did change a lot of folder name and file casing casing to be more Joomla compliant
    Don’t be scared you will not loose any Tags or data from your database! uninstalling do not remove currently any tables!

    New & Noteworthy

    cedThumbnails support in cedTag!

    • cedThumbnails show Related Stories Under Each Post, it is a small widget that appears under each post, linking to related stories from your blog archive,
    • cedThumbnails links to stories that are relevant and interesting to readers of a particular post, keeping them engaged with your blog, and increasing your traffic!

    You can now use Tags from cedTag to display related articles in Joomla. You can choose either

    • CedThumbnails&160; (require extension CedThumbnails)
    • Joomla - using Meta-Keywords


    Maintenance Page

    This new page will let you perform basic maintenance operations. Feel Free to ask for more operations using the support channel (Forums or Feedback (UserVoice))

    Replace Tag xxxx with Tag yyyy in all articles with Tag xxxx


    Add Tag yyyy to all articles which have also Tag xxxx


    Remove Tag xxxx to all articles which have also Tag yyyy.


    NEW:change position of tag in category view, blog view that you can set tags to appear after intro text (show after text before readmore button)

    NEW:version of extension is now displayed in administrator backend panel.

    NEW:Adding a&160; “Clear All” button in&160;&160; “TERM MANAGER” to remove all Tags and all


    Bug Fixing

    fix 500 error

    This error is now solved for good, was in cedtag component SEF (Thanks to Signature Ltd)

    BUG: missing CSS style on ads top


    The whole code has been validated using PHP code guidelines PSR-0/PSR-1/PSR-2



    Your ideas are important, feel free to contact me and ask for new features!

    You can download the latest version and just upgrade without any loss of data by reinstalling the package


  • cedTag provide a useful way to group related posts together and to quickly tell readers what a post is about. Tags also make it easier for people to find your content. Tags are similar to, but more specific than, Joomla categories.

    What’s NEW

    NEW: Adding a debug switch in administrator configuration area, this will write a file at logs/cedtag.php that contains some debug information that may be useful to spot difficult bugs,

    NEW:a new css file (/media/com_cedtag/css/blog.css) is added to the blog layout to give you more control on the rendering of top and bottom publicity,

    BUG cedtag was adding ul no matter if tags were available for the current article.

    BUG title of html page was not translated correctly and was displayed wrongly like this

    <title>%1$s items tagged with %2$s | created %3$s | Hits: %4$sjoomla | test</title>

    BUG solve cedtag: Warning: Missing argument 8 for plgContentCedTag::execute(), called in /htdocs/public/www/plugins/content/cedtag/cedtag.php on line 72 and
    defined in /htdocs/public/www/plugins/content/cedtag/cedtag.php on line 136 Fatal error: Call to a member function get()
    on a non-object in /htdocs/public/www/plugins/content/pagenavigation/pagenavigation.php on line 30



    what are the features of cedtag? get an overview by reading

    Your ideas are important, feel free to contact me and ask for new features!

  • cedTags_for_joomla

    cedTag&160; has been released and it is still beta, it has been made available to gather feedback. Don’t use it in production or at your own risk. I plan to use it before the end of months on my site. I would love to hear what is missing, what you don’t like, how it can be better.

    A real free tag system for Joomla!

    Front end features

    • Show tags at the bottom of each article.
    • Tag list view
    • Tag blog view
    • Most popular tags.
    • Most hits tags.
    • Latest tags.
    • SEF support, compatible with sh404SEF,ARTIO JoomSEF,AceSEF
    • XMap Plugin
    • Language file support
    • Add/Edit tags
    • Compatible with JoomlFish
    • Search plugin.

    Back end features

    • Import Tags from Meta keywords
    • Import tags from 3rd party system
    • Term editable.
    • Batch term add.
    • Batch tag management.
    • Auto extractable tag.
    • Language file support
    • Template edit online.
    • Tags filter by section and category.
    • One click installation.

    User of Joomla Tags, just install this all in one package and select Import – Souce – Joomla Tags and click import to copy your data in the new table.

    cedTag a new Tag system for Joomla 2.5 (based on Joomla tags) is now deployed on my showcase


  • CedThumbnails has been updated to version 2.5.5 and contains 1 new features for both Joomla 1.7 and Joomla 2.5. For existing users the update will display in the Extensions Manager under Updates. If you do not have this currently installed, you can click the link below and install as normal via the Extensions Manager.

    What’s new?

    • Video Thumbnail Feature: Google Youtube video are now supported as thumbnails!
    • Administrator panel
    • Update server simplified

    Full list of changes available in GIT commit aa32de404c928f3bd0fc67d7b9302e236893fd48

  • CedThumbnails has been updated to version 2.6.0 and contains 4 new features and correct 1 bug for Joomla 2.5. For existing users the update will display in the Extensions Managerunder Updates. If you do not have this currently installed, you can click the link below and install like you are use to via the Extensions Manager.

  • apache_maven

    Doxygen phpDocumentator phpunit-logo teamcity512 maven4php

    Maven for PHP uses the power of Maven for building, reporting on and creating documentations of PHP projects. It adapts the Maven build lifecycle to the PHP world while fully supporting PHP 4 and PHP 5. PHP for Maven uses PHPUnitfor unit testing and doxygenfor creating the api documentation.
    Use a PHP library project to create a library that can be used by other PHP libraries or PHP web projects. Use a PHP web project to create a standalone web project.

    So I quickly describe what I did install on my root server (OpenSuse 11.X)

    My Objectives: being able to build all my Joomla! component using best agile development practices

    “Specific tools and techniques such as continuous integration, automated or xUnit test, pair programming, test driven development, design patterns, domain-driven design, code refactoring and other techniques are often used to improve quality and enhance project agility.”


    While not needed as TeamCity has an integrated Maven engine, I would like to use an external MAVEN version, in order to have the latest version and living dangerously on the edge!

    So I download

    # wget

    And unpack

    # tar xvf apache-maven-2.1.0-bin.tar.gz

    Since I would like to avoid having a version number in my configuration build path, I create a symlink

    # ln -s apache-maven-2.1.0 maven

    I just now tell TeamCity to use my own Maven version, by specifying the Maven Home Path



    phpDocumentor is an open source documentation generator written in PHP. It automatically parses PHP source code and produces readable API and source code documentation in a variety of formats. phpDocumentor generates documentation based on PHPDoc-formatted comments and the structure of the source code itself. It supports documentation of both object-oriented and procedural code. phpDocumentor can create documentation in HTML, PDF, CHM or Docbook formats.

    Can be installed using PEAR, simply run

    # pear upgrade PhpDocumentor
    downloading PhpDocumentor-1.4.2.tgz...
    Starting to download PhpDocumentor-1.4.2.tgz (2,421,028 bytes)
    ..............................................................................done: 2,421,028 bytes
    upgrade ok: channel://


    PHPUnit is a unit testing framework for the PHP programming language. Created by Sebastian Bergmann, PHPUnit is one of the xUnit family of frameworks that originated with Kent Beck's SUnit.

    Can be installed using PEAR, simply run

    # pear upgrade PHPunit


    Doxygen is a documentation generator for C++, C, Java, Objective-C, Python, IDL (Corba and Microsoft flavors), Fortran, VHDL, PHP, C#, and to some extent D. It runs on most Unix-like systems, including Mac OS X, as well as on Windows. The first version of Doxygen borrowed some code of an old version of DOC++; later, the Doxygen code was rewritten by Dimitri van Heesch. from

    # zypper se doxy
    Lese installierte Pakete...

    S | Name       | Zusammenfassung                                    | Typ 
      | doxygen    | Automated C, C++, and Java Documentation Generator | Paket
      | doxywizard | Graphical User Interface for Doxygen               | Paket

    # zypper in doxygen

    Herunterladen von Paket doxygen-1.5.5-17.1.x86_64 (1/1), 2,3 M (6,2 M installiert)
    Lade herunter: doxygen-1.5.5-17.1.x86_64.rpm [fertig] 
    Installiere: doxygen-1.5.5-17.1 [fertig]


    Prepare Artifactory by adding new Maven for PHP repositories


    As Admin user (you cant go to that links without being an admin!), add 2 new repositories


    In Maven settings.xml

    In order to use Artifactory at his best (proxy and caching of remote repositories), I have a Maven settings.xml that contains ONLY

    # vi /home/teamcity/.m2/settings.xml



    Attention: Artifactory WIKI tell to use and not on my HOST with mod_proxy it made an error 404 If I do not add a slash at the end. Try with your host before, you will gain a lot of time by checking if the URL is valid!

    Note that http://url:port/artifactory/repo/ is a virtual repositories that proxy all external repositories



    Use SolarJoomla (hopefully to be distributed this week) to have a running Eclipse, PDT, Maven 4 PHP environment, Mylyn, TeamCity in no time

    Lets build!

    First I create a new Maven Project with Archetype “Maven for PHP” “PHP5 libraries”

    In TeamCity I did create a new project “Joomla 15 components plugins and modules” and a new Build “MyGuestbook”.


    The first build failed with

    [INFO] PHP Warning: require_once(PHPUnit/TextUI/TestRunner.php): failed to open stream: Operation not permitted

    This is because of my PHP security restrictions, I only allow file to be opened from /home/teamcity/

    So I just add

    /home/teamcity/TeamCity/buildAgent/ to my open_basedirin my php.ini

    ; open_basedir, if set, limits all file operations to the defined directory
    ; and below.  This directive makes most sense if used in a per-directory
    ; or per-virtualhost web server configuration file. This directive is
    ; *NOT* affected by whether Safe Mode is turned On or Off.
    open_basedir = /srv/www/vhosts:/tmp:/home/teamcity/TeamCity/buildAgent/

    To be continued

    So long an empty PHP project is building successfully, tomorrow I will try to make a REAL Joomla! component build there!

    As soon as It works, and all my Joomla! components are running in TeamCity, I will try to achieve the same goal in Bamboo, why? because it is simply . . .fun!


  • css.sprite.generator

    Here is an useful tool for improving performance of your website: The CSS sprite generator takes a number of source images and combines them into a single "sprite" image and supplies CSS to map to each image within the sprite. The technique this tool employs is often used to improve the performance of a web site by reducing the number of HTTP requests that the client's browser needs to make.

    CSS sprites are a way to reduce the number of HTTP requests made for image resources referenced by your site. Images are combined into one larger image at defined X and Y coordinates. Having assigned this generated image to relevant page elements the background-position CSS property can then be used to shift the visible area to the required component image.

    This technique can be very effective for improving site performance, particularly in situations where many small images, such as menu icons, are used. The Yahoo! home page, for example, employs the technique for exactly this.

    I’ve installed a copy of this tool at:

    And took time to:

    1. Improve the overall internal security of the tools, by using some technique of Joomla! framework, so most type of attacks (XSS, parameter tampering, path browsing, avoid direct execution of files) should be eliminated,
    2. The tool now extract the ZIP file without being forced to use the dangerous shell_exec php command (I switch it off on my host anyway), the tool support&160; if they are available in that order: ZipArchive(), zip_open() and shell_exec()
    3. Make the code a bit more portable (avoiding .. inclusion for files, use DIRECTORY_SEPARATOR)

    And I did audit the code using Acunetix Web security Scanner, the result can be seen below:


    The source code for CSS Sprite Generator is available for download and is covered by a BSD license. Want to run a local copy, get the source code at

    My version will be available soon, link to appear later this week.

    Note about PHP and Zip support

    To install zip PECL package run the following as root:

    # pear install

    and create a new file at

    # vi /etc/php5/conf.d/zip.ini

    with following content

    Restart apache

  • Debugger are full-featured PHP debugger engine. They are interactive tools that allows
    you to debug PHP scripts locally or remotely, from an IDE or from the console. There is 3
    debugger on the market, XDEBUG (open source) , ZEND (closed source), DBG (commercial
    but source code available) by luck all are free :-)

    I recommend you to develop with Eclipse PDT: The Eclipse Foundation has released the 1.0
    of the Eclipse PHP Development Tools (PDT) project. Eclipse PDT is a set of tools and
    frameworks that enhance the productivity of developers using PHP, a popular, general-purpose
    dynamic language that is especially suited for development of web applications and web services.

    I have prepared a HowTo also for eclipse PDT, but it is still not ready for prime time.


  • Native debugger.
  • Debug locally or remotely
  • JIT. When enabled it can start debugging Just In Time when an error happens.
  • Supports back-trace, e.g. displays a list of all procedures with their local variables,
  • Step-in, step-out, step-over, run to cursor, change execution point withing current scope...), evaluate any valid php expression(s) or inspect arrays, classes and simple variables, modify their values on the fly and even create any new variables.
  • Supports conditional breakpoints and even global ones
  • Allows to change execution point
  • has embedded profiler,
  • Allows multiple debugger processes running simultaneously.
  • Has open COM interfaces for integration with win32-based 3rd party IDEs.
  • Linux, BSD, SunOs, MacOs and Win32 are supported.
  • &160;



    Xdebug provides:


    Debugger Extension can be downloaded from Zend Downloads

    Zend debugger in Eclipse also works for MySQL statements!

    Installing ZEND debugger in Eclipse

    The Zend Executable Debugger Eclipse plugin adds PHP debugging capabilities to the Eclipse environment.

    Add the following remote location to the eclipse manager, even if you have eclipse PDT

    ZEND debugging mysql statement

    You'll have to configured the PHP binary included with the ZEND debugger to be able to debug SQL queries. Search for a PHP.ini in your eclipse/plugins directory, you'll find 2 files.


    • E:\eclipse\bin\PDT\plugins\org.zend.php.debug.debugger.win32.x86_5.2.12.v20071210\resources\php4\php.ini
    • E:\eclipse\bin\PDT\plugins\org.zend.php.debug.debugger.win32.x86_5.2.12.v20071210\resources\php5\php.ini

    And add these line in one of these files according to your PHP version

    extension_dir = "xampp_path/php/ext"
    include_path =".;xampp_path/php;"

    Installing Zend debugger server in XAMPP

    Please note that the Zend Executable Debugger is not available from the Eclipse PDT update Manager, so download ZEND debugger (Free) from Zend Downloads, you must extract the zip

    In the zip file, you'll see multiple directories

    Use the version that match the one in XAMPP (you have note at chapter A, for me 5.2.3 so copy files from 5_2_x_comp) and copy the dll in


    Open the file php.ini located at xampp_path\apache\bin\php.ini
    and add these keys if they do not already exist:

    ;; Only Zend OR (!) XDebug

    ; this is to see output while debugging
    implicit_flush = On

    Switch off all other debugger as it may conflict with Zen


    Restart apache, check for proper operations by going to http://localhost

    Apache will crash if you have more than one key in php.ini with the name zend_extension_ts, so uncomment all other entries!


    Debugging PHP in Eclipse PDT

    Go to Debug dialog for creating and managing run configurations

    • Choose as Server Debugger: Zend Debugger
    • Choose as PHP Server: XAMPP
    • File should point to the root of your Joomla! installation ex: /PROD2/index.php because in XAMPP htdocs directory I have a subdirectory /PROD2 with Joomla! 1.5 inside
    • Remove the option Break at First Line
    • Keep URL to Auto Generate

    As seen in the screen shot below


    Now click on button configure

    • Give a Name, not important here, lets keep XAMPP
    • Enter the root URL that points to the document root of this server, for me it is http://localhost/PROD2


    Go to tab "Path Mapping"

    • As Path on server enter E:\xampp\htdocs\PROD2
    • Choose Path in Workspace /PROD2



    Confirm all windows, and you can now start the debugger by clinking on debug button zend.debugging.eclipse.joomla_3

    You're done, you can now set breakpoint and debug Joomla! or your code easily






    Installing Joomla in Eclipse

    We will now install Joomla 1.0.15 and Joomla 1.5.1 (newest version at time of writing into eclipse)
    Create two new PHP project in your workspace, one name joomla1.0.x the other joomla1.5.x for example

    Attention: the root workspace must be located at xampp_path/htdocs


    Setting Zend Debugger in Eclipse PDT for Joomla!

    In the PHP perspective of eclipse, go to the menu debug

  • I use previously Jedit ( and reach the limit very fast (no versionning, no helper, nothing...)  I recommend to  any serious developer to install:
    1. Eclipse from free
    2. PHPEclipse plugin from phpeclipse free
    3. A concurent versionning system: CVS fro windows CVSNT  free
    4. A runnable Mambo environment like EasyPHP free
  • agile.development


    Starting from now on, I will deliver all my latest (unstable) extensions versions through  my continuous build server. All request or bugs discovery that are requested in my forums and solved will lead to a new build that you will be able to download a lot faster than before.

    Thanks to Maven for PHP, I can now commit, 60 seconds later, unit test run and  the result is a direct download for my extensions snapshots.







    Here is an example with the module mod_related_thumb_items

    Head to

    Locate the module or component you are interested in:


    Click on the latest build, must be  Success


    If this build is a direct answer to a support request in my forums, or solve an issue, You should be able to see in changes the commit description, and even which file have been changed after and before the commit.


    But Hey! you want to download this latest build now, go to artifact


    Staying  on the edge by using RSS

    You can monitor any build by using the RSS icon in your browser toolbar, or example with this module, it would be

    This way of downloading the latest extensions do not replace the page where there is there only stable versions.

    The next step is to make the maven phase “site” work (I have issue with phpdocumentor not found), this will create automatically a internet site in one of my sub-domains ad hide this complexity.

  • joomla_cms


    Digital watermarking is the process of possibly irreversibly embedding information into a digital signal. The signal may be audio, pictures or video, for example. If the signal is copied, then the information is also carried in the copy. In visible watermarking, the information is visible in the picture or video. Typically, the information is text or a logo which identifies the owner of the media.[Wikipedia]

    If you decide to go with an online watermarking, you can let watermark picture on the fly using php and .htaccess (at the cost of additional CPU server resources).

    Why Watermarking pictures?

    There is a lot of reasons, among others:

    • To limit images stealing, advanced users will still be able to crop/blur your watermark through!
    • To drive more new users/returning visitors to your site, anybody using your images in a forums may want to visit your site if the watermark can be read (don’t use complex logo, except if you have a well known brand)
    • To advertise your online work,

    This article is a follow up of a previous article presenting how to watermark picture offline (definitive watermarking) using ImageMagick bash script. A lot of steps described there still apply


    • Watermark pictures on the fly as soon as they are bigger than 500 pixels in width (PHP)
    • Watermark all or only pictures that are hot linked from outside your blog, for example in forums, other blogs (.htaccess setting)
    • Don’t watermark pictures hot linked from search images engine: Google images search or other (.htaccess setting)
    • Easily extensible to your needs: support multiple watermark pictures based on original image size.


    create a file .htaccess with the following content, I recommend you to save it at the root of Joomla!® directory structure, you can merge this file with the one provided by Joomla!

    # Uncomment next line to avoid that watermark apply on your
    # site, replace with you Joomla! base
    rewritecond %{http_referer} !^
    http://([^.]*[.]*)? [nc]

    # Uncomment next line to avoid applying watermark in Google images
    # search, copy as many lines as needed if you would like to also add Bing, Yahoo, etc...
    rewritecond %{http_referer} !^
    http://(www.)? [nc]

    RewriteCond %{REQUEST_FILENAME} –f

    # Path to the watermark.php script, and list of supported images
    RewriteRule \.(gif|jpeg|jpg|png)$ /images/watermark.php [QSA,NC]

    watermark.php script

    Save this script into Joomla!® /images directory, under /images/watermark.php

    Decide at which size you want to protect your images, here starting at 500pixels width, I will apply a watermark overlay in the left corner of the image.

      $image = imagecreatefromstring(file_get_contents($path)); 
      $w = imagesx($image); 
      if ($w > 500) { 
        $h = imagesy($image); 
        $watermark = imagecreatefrompng('watermark.png'); 
        $ww = imagesx($watermark); 
        $wh = imagesy($watermark); 
        imagecopy($image, $watermark, $w-$ww, $h-$wh, 0, 0, $ww, $wh); 
      header('Content-type: image/jpeg'); 


    It cost CPU and depending how you set your .htaccess may still allow users to steal images without watermark.

  • At SD Forum 2006, Randy Shoup and Dan Pritchett, both with eBay, gave a presentation on eBay's architecture. Pritchett subsequently posted his presentation slides in his blog, The eBay Architecture.
    Predictably, the presentation contained a few inspiring statistics, such as:
    • 15,000 application instances running in eight data centers
    • 212,000,000 registered users
    • 1 billion page views per day
    • 26 billion SQL queries and updates per day
    • Over 2 petabytes of data
    • $1,590 worth of goods traded per second
    • Over 1 billion photos
    • 7 languages
    • 99.94% uptime

    Other stats in the presentation related to development process and features, such as:

  • Over 300 new features released each quarter
  • Over 100,000 lines of code released every two weeks

"According to the presentation, the goal of eBay's current architecture is to handle an additional ten-fold increase in traffic, something eBay expects to reach within a few short years. Another architecture objective is to be able to handle peak loads, and for components to gracefully degrade under unusual load or in the case of system failures." read more  HERE


  • The major news I was waiting for:

    Eclipse Foundation, Zend Technologies, and IBM Announce the Approval of the PHP IDE Project
    The Eclipse Foundation, an open source community committed to the implementation of a universal software development platform, Zend Technologies and IBM, today announced that the Eclipse PHP IDE project has been approved by the Eclipse Foundation. The technology project was proposed by Zend and IBM on October 21, 2005. It will deliver a PHP Integrated Development Environment framework for the Eclipse Platform and will encompass the development components necessary to develop PHP-based web applications and will leverage the existing Eclipse Web Tools Project.

    Read the proposal here, If youre are in the area of Santa Clara, Zend is showing  demo at EclipseCon. Do someone know what wwill happen wwith ???

  • The PDT project is working towards providing a PHP Development Environment framework. This project was formerly known as PHP IDE.

    Make Eclipse PDT work for Joomla development

    Install a PHP debugger

    In order to be able to perform debugging using eclipse PDT, you must download one of the following extra packages:&160; XDEBUG or ZEND debugger. I was not able to get the debugger running with XDEBUG even after reading many tutorials and trial error approach. Both packages are free, and it has work nicely for me with ZEND debugger after 5 minutes...

    Unfortunately, XDEBUG/ZEND can not be packaged with PDT due to license restrictions, so both tools are not just running out of the box without few efforts.

    PDT and Zend Debugger


    PDT + Zend in one package thanks to (118MB), highly recommended

    OR PDT (105MB) and add Zend debugger through software update later

    • Open Eclipse and go to Help-> Software Updates-> Find and Install
    • Select "Search for new features to install" and click "Next"
    • Create a New Remote Site with the following details:
    • Name: PDT
    • URL:
    • Check the PDT box and click "Next" to start the installation

    XAMPP, Zend debugger working together

    open the php.ini located at \xampp\apache\bin\php.ini

    and add the following



    • Only one key zend_extension_ts is allowed per php.ini file, un-comment all other or it wont work,
    • Attention: I did not move ZendDebugger.dll but use the one coming with eclipse Zend plugin, this may cause issues, if you update this plugin and the path change...

    Restart XAMPP apache

    By going to http://localhost/xampp/phpinfo.php check that you have a section Zend Debugger

    Put now a breakpoint in index.php of any Joomla! installation or deeper in any component you want to debug

    And right click on index.php, debug as PHP Web Page (Alt-Shift-D, W)


    While the first page get properly rendered in the internal browser of eclipse PDT, I was getting some strange rendering issues (html code produced look fine), by using an external browser like Chrome, Firefox, the problem has disappear.

    PDT and XDebug

    Installing with PEAR/PECL is as easy as opening a command prompt and typing

    # \xampp\php\pecl install xdebug

    open the php.ini located at \xampp\apache\bin\php.ini

    and un-comment the following



    ;; Only Zend OR (!) XDebug


    1. Modify the correct php.ini file, check the page phpinfo, normally the right php.ini is located at \xampp\apache\bin\php.ini
    2. You need to comment out any other references to &8220;zend_extension_ts&8221; in the php.ini file (the zend optimizer use it already as default)
    3. Restart apache, and check the page http://localhost/xampp/phpinfo.php to make sure XDebug has been successfully installed

    debugging AkoBookPlus:



    Add subversion plugin

    Install subversive by pointing the update manager to subversive update site


    You need also to install SVN connectors by adding a new update site: - [required] Subversive SVN Connectors


    Eclipse will restart, you should be able to browse repositories.

    Happy Joomla! development and PHP debugging!

  • apache_maven

    This issue has turn me upside down a long time. In fact in the official Google Group I was not the only one to have this issue.

    I did try the following, and it is always good to check first

    • Checking PHP version,
    • Starting Maven with -X for having more debug information
    • Testing it in Eclipse + M2Eclipse on windows, was working there,
    • Comparing calculated PHP include path on Windows and Linux: they were identical in this case

    Only my Linux box was not working. . .(

    After that I did materialize the eclipse project of maven-php-plugin and even built a custom version that I’ve deployed without any effort to my Artifactory (

    And what is the solution?

    it my server configuration and paranoia :-)

    open your php.ini, ideally the right one, don’t put your server at risks: You may have many under Linux, especially if you use plesk or cpanel 

    • cli at /etc/php5/cli/php.ini
    • apache2, /etc/php5/apache2/php.ini
    • fastcgi at /etc/php5/fastcgi/php.ini

    location most of the time


    and add the directory where your build server make a checkout...

    ; open_basedir, if set, limits all file operations to the defined directory
    ; and below.  This directive makes most sense if used in a per-directory
    ; or per-virtualhost web server configuration file. This directive is
    ; *NOT* affected by whether Safe Mode is turned On or Off.
    open_basedir = /www/vhosts:/tmp:/xxxx/yyyy/

    Next step is to put Joomla! 1.6 and all their PHPUnit tests a run along with Selenium. May also need to  patch Maven for PHP to better support Tests reporting like Surefire.