VarjuOrg

Linux / Windows – what’s the difference…

PHP

How to install Symfony3 under shared webhosting in Developement mode

1. Log in to SSH 2. Install Composer (We assume that composer is not yet installed): export COMPOSERDIR=~/bin;mkdir bin curl -sS https://getcomposer.org/installer | php — –install-dir=$COMPOSERDIR –filename=composer (Composer will be installed under: /home/username/bin/composer ) 3. To test that installation was successful – You can run: ~/bin/composer 4. Make environment global INSTALLDIR: export INSTALLDIR=~/public_html/symfony mkdir $INSTALLDIR […]

, , ,

unserialize() : Error at offset XX:XXX

Food for thought: 1. Probably Your charset is wrong (after PHP 5.5) – Set charset after open tag: header('Content-Type: text/html; charset=utf-8'); – And set charset utf8 in your database : mysql_query("SET NAMES 'utf8'"); 2. Your serialized array is faulty Could be fixed by: $fixed_data = preg_replace_callback ( '!s:(\d+):"(.*?)";!', function($match) { return ($match[1] == strlen($match[2])) ? […]

Nifty snippet in PHP to get POST GET and SESSION variables

<?php echo ‘<pre>’; print_r($_SESSION); print_r($_POST); print_r($_GET); echo ‘</pre>’; ?>  

, ,

PHP: Graafiline % pilt lehele

Image link: <img alt="" src="bar.php?val=10&amp;max=100" />

, ,