So increase the memory_limit to 128M in the /etc/php5/cli/php.ini file. Building will work fine.:)
Thursday, February 23, 2012
Symfony Build: Fatal error: Allowed memory size of x bytes exhausted
If you run a symfony command, it is run by php cli, not apache.
Labels:
build,
doctrine,
fatal error,
symfony
Create Plugin in Symfony
- Install: sfTaskExtraPlugin
- Generate a plugin (example): symfony generate:plugin sfPaypalPlugin
- Generate a module (paypal) in a plugin (sfPaypalPlugin): symfony generate:plugin-module sfPaypalPlugin paypal
Wednesday, February 22, 2012
Allow Website from Fix IPs in Apache
Add this to the directory configuration in virtualhost:
Order Deny, Allow
Deny from All
Allow from 110.70.55.154 10.0.0. 173.0.82.126 127.0.0.1
Order Deny, Allow
Deny from All
Allow from 110.70.55.154 10.0.0. 173.0.82.126 127.0.0.1
Labels:
apache,
ip,
virtual host
Disable Apache Server Signature
Add ServerSignature Off to virtualhost configuration. Restart Apache.
Labels:
apache,
virtual host
Remove Accents in String with ICONV
Don't forget: Iconv translit is locale sensitive. You must first set locale:
// remove hungarian accents // magyar ékezetek eltávolítása setlocale(LC_ALL, 'hu_HU.UTF8'); $text = iconv('UTF-8', 'ASCII//TRANSLIT', 'árvíztűrő tükörfúrógép'); echo $text = str_replace(array('\'', '"', ':'), array(), $text);
url_for Helper in Action in Symfony
$this->getContext()->getConfiguration()->loadHelpers(array('Url')); // now you can use url_for()
Tuesday, February 21, 2012
Install Symfony Plugin: Warning: require_once(PEAR.php): failed to open stream
- If you try to install a plugin (ex. prestaPaypalPlugin) with symfony cli and get something like this...
sakra:/var/www/sakra# ./symfony plugin:install prestaPaypalPlugin
>> plugin installing plugin "prestaPaypalPlugin"
Warning: require_once(PEAR.php): failed to open stream: No such file or directory in mnt/vol1/vol1/www/sakra/lib/vendor/symfony/lib/plugin/sfPearEnvironment.class.php on line 15
Fatal error: require_once(): Failed opening required 'PEAR.php' (include_path='.:/usr/share/php:/usr/share/pear') in /mnt/vol1/vol1/www/sakra/lib/vendor/symfony/lib/plugin/sfPearEnvironment.class.php on line 15 - Run: apt-get update
- Run: apt-get install php-pear
- Run again: ./symfony plugin:install prestaPaypalPlugin
- If you get an error like this...
No release available for plugin "prestaPaypalPlugin" in state "stable" - Run with -s parameter (to enable beta plugins): ./symfony plugin:install -s beta prestaPaypalPlugin
Parse YML (Yaml) Files In Action in Symfony
$myarray = sfYaml::load(sfConfig::get('sf_config_dir').'/myconf.yml');
Monday, February 20, 2012
Disable Symfony Application for Maintenance
- Put check_lock: true inside the (ex.) prod section of apps/frontend/config/settings.yml.
- Create an unavailable.php file in the root config dir (project folder/config).
- Clear the cache (symfony cc).
- Run symfony project:disable frontend prod to disable the prod environment of the frontend application. To enable, just change the disable word to enable.
Labels:
application,
maintenance,
settings.yml,
symfony
Wednesday, February 8, 2012
Format Date Based On User Culture in Action in Symfony
$user_culture = $this->getUser()->getCulture(); $formatdate = new sfDateFormat($user_culture); echo $formatdate->format(strtotime('2012-02-08'), 'd'); // 'd' is a pattern
Subscribe to:
Posts (Atom)