JAVIER MARTINEZ

Web Developer

Etiqueta: OSX

“Unable to create the cache directory” error in Symphony2

One common issue in Symfony2 projects is bad directory permission settings. The “app/cache” and “app/logs” directories are the only who writes Symfony2.

Change “_www” to the web server user and “javierms” to your command line user:

$ rm -rf app/cache/*
$ rm -rf app/logs/*
$ sudo chmod +a “_www allow delete,write,append,file_inherit,directory_inherit” app/cache app/logs
$ sudo chmod +a “javierms allow delete,write,append,file_inherit,directory_inherit” app/cache app/logs

Create a SSL certificate on OS X

cd /etc/apache2
sudo ssh-keygen -f server.key
sudo openssl req -new -key server.key -out request.csr
sudo openssl x509 -req -days 365 -in request.csr -signkey server.key -out server.crt

The field “CommonName” of the certificate must match the ServerName directive in the Apache configuration file /etc/apache2/httpd.conf

Add the fol­low­ing to your httpd-ssl.conf to use the new certificate:

SSLCertificateFile “/etc/apache2/server.crt”
SSLCertificateKeyFile “/etc/apache2/server.key”

Alternative PHP Cache (APC) on OS X

The PHP installed in OS X 10.8 is 5.3.10. We install PHP 5.4 from the php-osx project opening up a Shell and execute the following line:

$ curl -s http://php-osx.liip.ch/install.sh | bash -s 5.4

We should link to the new php file:

$ sudo mv /usr/bin/php /usr/bin/php53
$ sudo ln -s /usr/local/php5/bin/php /usr/bin/php

We execute the following line:

$ sudo pecl install apc

Last we should insert the following lines in the php.ini:

extension=apc.so
[apc]
apc.enabled=1
apc.shm_segments=1
apc.shm_size=32M
apc.cache_by_default=1
apc.stat=1
apc.stat=7200 //2 hours

© 2017 JAVIER MARTINEZ

Tema por Anders NorenArriba ↑