I’ve to admit that I’ve found a big mistake in my programming when handling utf8 data in PHP. I’ve always included this header:
header("Content-type: text/html; charset=UTF-8");
With this header being sent the browser selects utf8 character set and everything works, the browser receive utf8 encoded text and displays it correctly, it sends back utf8 from . . . → Read More: Using utf8 the right way in PHP & Java
PHP has several places where configuration can be set. While I had an idea of the precedence of those settings, I decided to test them experimentally to be sure of what I am going to say. In particular this post is focused on error_reporting, but the same considerations can hold true for any setting.
So . . . → Read More: PHP Configuration, php.ini and overrides
Unit testing is useful to test individual parts of the program, to check if they respect the specifications. Actually as any type of testing, can only point out bugs, but can’t prove that the program is correct.
Despite that, they are very useful during development, as TDD (Test Driven Development) suggests, it can be . . . → Read More: PHPUnit, Unit Testing with PHP
Roundcube is a nice Ajax based webmail, but I was experiencing slow performance. I checked MySQL slow query log and I found queries taking several seconds. Expecially session and cache-update queries were taking as much as 9 seconds. This is really a long time for an interactive and fluid user experience. I’ve checked Roundcube version . . . → Read More: A simple Roundcube optimization
When using php setlocale() function it’s important to check the return value. I used to call it without checking it as in:
Without figuring out that if the locale it_IT.UTF-8 is not present in the system, the setlocale function fails and returns false.
The first idea I had to try to add the . . . → Read More: Configuring locales on Ubuntu
Today I try to enable debugging of PHP with Netbeans on the windows platform. For this reason I’ve downloaded the thread safe version of xdebug and placed it in my extension directory, in my case C:\easyphp3\php\ext
As explained in “Introducing xdebug” to activate it I added the following in my php.ini
After restarting . . . → Read More: Debugging PHP code with Netbeans
PHP / Java Bridge is an interesting technology to allow to connect PHP with a Java virtual machine. On the official site they claim “It is more than 50 times faster than local RPC via SOAP, requires less resources on the web-server side, and it is faster and more reliable than communication via the Java . . . → Read More: Configuring Apache / PHP with JavaBridge to Tomcat 5.5
Here is how I configured Apache with PHP and mod SSL. The new PHP 5.2 is just out and I need CURL that wasn’t previously included in my last build.
# cd mod_ssl-2.8.28-1.3.37 # ./configure –with-apache=../apache_1.3.37 # cd ../apache_1.3.37 # SSL_BASE=/usr ./configure –prefix=/usr/local –enable-module=so \ –enable-module=speling –enable-module=rewrite –enable-module=ssl # make # make install # cd . . . → Read More: Apache 1.3.37 – PHP 5.2.0 – ModSSL 2.8.25
After having installed PHP5 SOAP support it’s time to try it… I’ve read the article PHP SOAP Extension from Zend.
Calling a method using WSDL is really easy:
<?php $client = new SoapClient("http//services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl"); print($client->getQuote("ibm")); ?>
But my aim is to build a small SOAP server. The first step is to create the WSDL and a . . . → Read More: Working with SOAP in PHP
Today I’ve to build a simple webservice using PHP, unfortunately my PHP installation has been built without support for it, so it’s time to update my configure line to add soap support:
PHP MODULE # make distclean # ./configure –enable-memory-limit \ –disable-url-fopen-wrapper –with-gd –enable-dbase –enable-exif \ –enable-ftp –with-gettext –with-iconv –enable-mbstring \ –with-jpeg-dir=/usr/lib –with-zlib-dir=/usr/lib –with-kerberos \ . . . → Read More: PHP5 and Soap