An open source web application meant to help manage & create invoices in a simple, straightforward way.

Small issue upgrading PHP to 5.3

Although we are still in beta version, as we said over and over again, there are people who have installed Siwapp on their own server. If you’re one of those people, intrepid adventurer, and you have decided to try luck with the latest version of PHP (5.3), you can suddenly get a 500 error when trying to access the application.

It is not my intention to enter into boring technical details, but think it is necessary a brief explanation. When you log into the application, it performs some checks for recurring invoices. These verifications are associated with other checks in the customers table that should have no effect in normal conditions.

Each customer is associated with an internal name that is generated from its own name. The programming associated with that task has not changed, but behaves differently in PHP5.2 and PHP 5.3: before accented vowels were removed, now they are replaced by non-accented vowels. Therefore, a customer whose name is “Fundación ABC” (“ABC Foundation”), in PHP 5.2 had an internal name such as “fundacinabc” but in PHP 5.3, the generated internal name is “fundacionabc”. As the internal name is used to decide if we create a new customer object, it is possible that a customer created in the old environment appear as nonexistent in the new environment, and the application will try to create it again as a new customer, producing the error.

Well, at the end it has not been such a short explanation.


If your customers do not have names with accented vowels or non US characters you probably will have no problem. If you get that error you can do one of these things:

  1. If you installed from a package downloaded from the web or you installed through subversion and you are in a tag (RELEASE_0_3_…), apply this patch.
  2. If you use subversion and you are in /trunk just update.
  3. Wait to 0.4 version.

In UNIX system you can apply the patch (assuming you copied and uncompressed it to the root of your install) doing:

cd /path/to/siwapp
patch -p0 -i rebuildSlugsTask.diff

It will patch a file and create another one.

In windows you can try reading this and this first. However, an expert in Windows can leave a more precise instructions in the comments.

Execute the task

The patch added a task that must be executed in command line:

php symfony siwapp:rebuild-slugs

It will rebuild the internal names for all your customers and report the number of customers modified.

Thats all!


  1. Leroy
    Posted 2012/01/31 at 16:02 | Permalink

    Small issue?? this is a big issue!
    I cant work with my Siwapp anymore. And i lost all my invoices. I have to look for another opensource invoice solution right now. I don’t understand the fixes you come up with. And im not that technical.

  2. Posted 2012/01/31 at 16:53 | Permalink

    What have you done? When did it stop working? Was it upgrading to PHP5.3? Trying to apply the patch?

  3. Leroy
    Posted 2012/01/31 at 20:29 | Permalink

    My Siwapp used to work.. i didnt changed anything…
    but suddenly when surfing to my siwapp i had a internal server error.
    So i reinstalled the latest version. All chmod and settings where correct and siwapp said it was installed. but when going to /web/
    Still internal server error.
    I thought first it was because my php version when i saw this message… but now i see that i still have php 5.2.17

    My system info:
    Apache 2.2.21 Running
    DirectAdmin 1.39.3 Running
    Exim 4.76 Running
    MySQL 5.0.67 Running
    Named 9.3.4 Running
    ProFTPd 1.3.3c Running
    sshd Running
    dovecot 2.0.16 Running
    Php 5.2.17 Installed

  4. Leroy
    Posted 2012/02/02 at 20:57 | Permalink

    Im running it on a localhost server now! (wamp)
    Pretty good solution for now… maybe in the future ill give it another try.