Click Fraud Protection
PHP related blog, freelancer to hire!

Archive for the php Category

Zend Paginator – how to access objects, not data only

If you’re using Zend_Paginator, I’m sure on some point you’ll need to access your object instead of only data.   First of all you need to have your Zend_Db_Table defined with rowchild, for example if your table class is App_Model_Db_Books, add this variable protected $_rowClass = ‘App_Model_Db_Books_Row’; […]

Read more

Mongo PECL problem after update

If you’re experiencing following error after upgrading mongo from PECL “Exception: pass in an identifying string to get a persistent connection” You can uninstall new one pecl uninstall mongo and install previous pecl install mongo-1.0.10

Read more

FastCGI and PHP Auth (HTTP_AUTH) problem solved

There is a problem with Authorisation headers and php running as FastCGI. To solve it you need to tell FastCGI to pass authorisation headers and then translate it back to PHP So in your vhost file or .htaccess file do: RewriteEngine on RewriteCond %{HTTP:Authorization} ^(.+) RewriteRule ^(.*)$ […]

Read more

Zend_Test_Client problem with GET parameters in path

Let’s say you want to send REST request to http://test.server.int/articles and your provider requires to send token parameter – but in URL So your final url will be http://test.server.int/articles?token=12345 My client looked like: $rest = new Zend_Rest_Client(‘http://test.server.int’); $rest->restGet(‘/articles?token=123’, array(‘article’ => ‘<xml>YOUR XML</xml>’)); Fatal error: Uncaught exception ‘Zend_Uri_Exception’ […]

Read more

Testlink 1.9 problem with Charts – Error 500

Today I faced problem with Testlink 1.9 – while clicking on Test Results > Charts I’ve got : PHP Fatal error: require_once() [function.require]: Failed opening required ‘/var/www/html/testlink/cfg/.cfg.php’ (include_path=’.:/usr/share/pear:.:/var/www/html/testlink/lib/functions/:/var/www/html/testlink/third_party/’) in /var/www/html/testlink/lib/bugtracking/int_bugtracking.php on line 367, referer: http://xxxxxx/testlink/lib/results/resultsNavigator.php If you have similar edit /var/www/html/testlink/lib/bugtracking/int_bugtracking.php Line 363: $btsname = strtolower($bts_type); Dirty, […]

Read more

Prime numbers in PHP – quick and efficient way

Looking for a way to find prime numbers in php? I wfound one perl solution here, but it wasn’t perl magic – it was power of regular expressions. Please find code below which will be self-explanatory. <?php /** * Function checks if given number is prime * […]

Read more

Use PHP and PDO to connect to MS SQL Server (Zend Framework)

Problems connecting to MS SQL server from Zend Framework? Message: The mssql driver is not currently installed Solution is simple Install pdo_mssql driver: (Ubuntu) #sudo apt-get install php5-sybase #sudo /etc/init.d/apache2 restart On Centos you need to install pdo_dblib (any problems check here) It will not reflect in […]

Read more

PHP & MongoDB Sitting in a Tree: Part 1

Always wanted to try it, nice tutorial here http://www.dealtaker.com/blog/2010/05/12/php-mongodb-sitting-in-a-tree-part-1/

Read more

What should a developer know before building a public web site?

“The idea here is that most of us should already know most of what is on this list. But there just might be one or two items you haven’t really looked into before, don’t fully understand, or maybe never even heard of.” Great article here

Read more

Run PHP (and others) code in a browser – revolutionary pastebin

If you need to test a code in browser – try  http://ideone.com/ Entry found on http://alouche.net/blog/2009/11/24/ideone-compiler-pastebin/

Read more
Page 1 of 212