The Blog


Installing for PHP5 on Ubuntu 14.04

Posted on

sudo apt-get install php-pear
sudo apt-get install php5-dev

sudo pecl install dbase

sudo vi etc/php5/mods-available/dbase.ini <
sudo php5enmod dbase

sudo service apache2 restart

That should do it. I would do that on a temp Ubuntu and just copy the to the prod, so you do not install all that dev stuff in your prod env.

Posted in Linux, PHP 71 Comments

Time to move into PHP Framework

Posted on

Few of mine ecommerce client started to outgrow the ecommerce that I custom made for them. They’re into tens of thousands of orders and some sales reps have few hundred ship to addresses, things are no longer working well since concept of paging was not included in my original code and it feels like it’s too much work to individually try to think of all the areas where drop down menus or pages shows thousands of records that renders them useless.

So I’m going to try to recreate what I got for them in one of the available PHP framework. So far I’m looking at CodeIgniter, Symphony2 or Yii.

Idea is to create something that I can reuse for all those clients and also to create something that I can use just as a CMS for my other clients.

Main objective is scalability, security and future easy of expending, something that I’m missing in my current way of doing things.

Posted in PHP Leave a comment

Slick way to deal with 301 and 302 from Ajax call.

Posted on

On the Server side response with similar code:

header('HTTP/1.0 278 Ok');
echo json_encode(array('redirect' => "/"));

In JQuery bind AjaxSuccess to this function. Somewhere in a global header or layout page, so it get accesses from all pages.

$('body').bind('ajaxSuccess',function(event, request, settings){
if (request.status == 278){
jsonresponse = $.parseJSON(request.responseText);
window.location.href = jsonresponse.redirect;
Posted in PHP Leave a comment

Executing SQL directly in Symfony2 Doctrine

Posted on

Ok, so I’m moving project from non framework PHP to Symfony2, and it goes very nice, except of Doctrine, I’m sure it’s me. I’ve been using MySQL for last 8 years and DQL vs SQL to me feels like i.e. taking snowboard for the first time, after skiing for 30 years. What I do after 30 min. of trying. I’m going back to rental place and I switch to skis. Below one can find skis.
Read More

Posted in Frameworks, PHP, Symfony2 29 Comments
« Previous PageNext Page »