Tag Archives: php

Instagram PHP Wrapper

So today I finished up my Instagram wrapper. Instagram has become very popular over the last year or so but it still doesnt have a proper api wrapper for php. So I made one of my own that fits right in to Zend Framework since thats my framework of choice. You can ofcourse use this with other frameworks or standalone. It depends on a few components off Zend Framework though.

See it here https://github.com/ranza/instagram

Setup Zend_Rest_Route with multiple modules

Say you have an application and you want entire modules or just a controller to be treated and follow the RESTful ways you can do following in your bootstrap.php:

As you can see the 3th argument of `Zend_Rest_Route` will set “module”, or “module” => “controller”. Quite useful if you have an api module you want to treat as RESTful, or maybe a controller in a specific module used for some ajax stuff.

Debugging php can be a hurdle

Debugging PHP can be a hurdle. Specially if you dont have access to something like XDebug. A great way to solve those things is by reading the log files PHP and Apache is generating. One way is enabling error logging in htaccess like this:

[code]
php_flag log_errors On
php_value error_log /home/ranza/Sites/project/logs/php_errors.log
[/code]

Of course you need to create the php_errors.log file and set chmod to 755

So ive moved my entire website and all m…

So ive moved my entire website and all my minor projects to a new fancy vps. Its provided by slicehost which is awesome! From start till finish was about 5 minutes. How fast is that! – just wow…

In my setup i ran into a problem with apt, yes im a Debian when it comes to servers.

So i wanted to setup a new environment with PHP5.3 and MySQL5.1. Since Lenny (latest stable release of Debian) is way behind, as usual, i checked out dotdeb. They provide the latest and greatest in Debian packages, and yes also a PHP .deb pack. So i added the repository but apt wouldnt fetch the php5.3 package. After a few tries with taking out lines from sources.list i tried another apt tool, aptitude which just worked.

In my search for why this was, the great Guillaume Plessis commented on my question and gave me the following link on apt pinning. So i added a few lines in the preferences file and apt-get install now works just as aptitude!

This is also great if you want to run a stable environment but now and then check out the latest and greatest from unstable or testing.