September 26, 2012 at 21:35
· Filed under PHP, Web Development
I was looking for a minimalist way to use Twitter Bootstrap and Symfony 2 in a clean way. The solution I came up with is as follows:
- Create a new bundle.
- Register the bundle.
- Deploy the resources.
Create a new bundle
I created my bundle by hand, omitting some of the stuff you get when you generate the bundle via php app/console generate:bundle
. The folder structure underneath the src
directory looks as follows:
-- Acme
|-- TwitterBundle
|-- Resources
| |--public
| |--[TwitterBootstrapFiles]
|-- AcmeTwitterBundle.php
The content of AcmeTwitterBundle.php
is:
<?php
namespace Acme\TwitterBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class AcmeTwitterBundle extends Bundle
{
}
Register the bundle
To register the bundle add new Acme\TwitterBundle\OnTimeTwitterBundle()
to the $bundles array in app/AppKernel::registerBundles()
.
Deploy the resources
To deploy the files just execute php app/console assets:install --symlink web/.
Schlagwörter:
Symfony2,
Twitter Bootstrap
Permalink
Oktober 25, 2011 at 22:42
· Filed under PHP, Web Development
I had a bit of trouble getting Symfony 2 setup properly under PLESK (10.2.0).
I first created a subdomain using the „web“ directory of Symfony 2 as document root for the vhost.
However, I seemed to could not get rid of the errors calling config.php telling me, that app/cache and app/logs were not writeable by the server. After searching the web top to bottom and having a look at the output of php_info() I identified the culprit. PLESK sets open_basedir (the topmost directory that is accessible by your web server) to the document root:
open_basedir var/www/vhosts/<YOURDOMAIN>/ <SUBDOMAINHTTPDOCS>/Symfony/web/:/tmp/
To remedy this place a file called „vhost.conf“ under /var/www/vhost/<YOURDOMAIN>/subdomains/ <SUBDOMAIN>/conf
containing directives overriding PLESK’s settings, e.g.:
<Directory /var/www/vhosts/YOURDOMAIN/DOCUMENTROOT/Symfony/web>
<IfModule mod_php4.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir /var/www/vhosts/YOURDOMAIN/SUBDOMAINHTTPDOCS/:/tmp/:
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir /var/www/vhosts/YOURDOMAIN/SUBDOMAINHTTPDOCS/:/tmp/:
</IfModule>
</Directory>
Now to get the settings into the system run as root:
/usr/local/psa/admin/bin/httpdmng --reconfigure-all
Then restart Apache:
apache2ctl restart
Schlagwörter:
en,
open_basedir,
PHP,
PLESK,
Symfony2,
vhost.conf
Permalink
März 30, 2011 at 6:00
· Filed under PHP, Web Development
… works like a charm once you figure out to put
xdebug.remote_enable=true
into your php.ini.
Schlagwörter:
IDE,
PhpStorm,
Xdebug
Permalink