A PCRE internal error occured. This might be caused by a faulty plugin
====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
packages:amp:php [2014/09/23 12:03] admin [Installation] |
packages:amp:php [2014/09/24 03:45] (current) admin [Add Selected PHP Versions] |
||
---|---|---|---|
Line 30: | Line 30: | ||
Make sure you have [[packages:git|Git installed]]... | Make sure you have [[packages:git|Git installed]]... | ||
- | Also if you plan on using MySQL with your PHP installation, it is recommended you have it installed before you start the PHP version installation, see this section for more info on installing MySQL. | + | Also if you plan on using MySQL with your PHP installation, it is recommended you have it installed before you start the PHP version installation, see this section for [[packages:amp:mysql|more info on installing MySQL]]. |
=== Download the source === | === Download the source === | ||
Line 98: | Line 98: | ||
" | " | ||
</code> | </code> | ||
+ | You might need to chmod a+x custom-options.sh | ||
**Sample custom-php.ini** | **Sample custom-php.ini** | ||
Line 123: | Line 124: | ||
In most cases this means your system is missing some library to allow the required PHP options to execute. Installing the required libraries usually solves the problem. Here you can find an interesting [[http://www.robo47.net/text/6-PHP-Configure-und-Compile-Fehler|list of configure errors, along with the command to execute to resolve them]]. | In most cases this means your system is missing some library to allow the required PHP options to execute. Installing the required libraries usually solves the problem. Here you can find an interesting [[http://www.robo47.net/text/6-PHP-Configure-und-Compile-Fehler|list of configure errors, along with the command to execute to resolve them]]. | ||
+ | |||
+ | The "Unable to detect ICU prefix" isn't listed there, try:\\ | ||
+ | sudo apt-get install libicu-dev | ||
</WRAP> | </WRAP> | ||
+ | |||
+ | My setup required the following additional packages installation: | ||
+ | * apt-get install libxml2 libxml2-dev | ||
+ | * apt-get install libcurl3-dev | ||
+ | * apt-get install libjpeg62 libjpeg62-dev | ||
+ | * apt-get install libpng12-0 libpng12-dev | ||
+ | * apt-get install libicu-dev | ||
+ | * apt-get install libmcrypt4 libmcrypt-dev | ||
For what comes next, you should first have suEXEC and the mod_fcgid apache module installed [[packages:amp:apache#Install apache suEXEC|as described here]]. | For what comes next, you should first have suEXEC and the mod_fcgid apache module installed [[packages:amp:apache#Install apache suEXEC|as described here]]. | ||
Line 145: | Line 157: | ||
(Ctrl-x - Y: to exit nano saving file) | (Ctrl-x - Y: to exit nano saving file) | ||
+ | </code> | ||
+ | |||
+ | Then make it executable: | ||
+ | <code> | ||
+ | > chmod ug+x /var/www/php-fcgid/php-cgi-5.2.17 | ||
</code> | </code> | ||
Line 155: | Line 172: | ||
Please pay attention to this, as it might result in apache throwing internal error 500 when trying to run a wrongly owned script. | Please pay attention to this, as it might result in apache throwing internal error 500 when trying to run a wrongly owned script. | ||
+ | |||
+ | You can read a detailed explanation for all of this in the [[http://httpd.apache.org/docs/2.2/suexec.html|apache page regarding suEXEC]]. | ||
+ | |||
+ | <color coral>**TO ACHIEVE THIS WE'LL HAVE TO ADAPT THE SHARED FOLDERS MOUNTING OPTIONS IN /etc/fstab (TBC)**</color> | ||
+ | |||
+ | **YOU ALSO HAVE TO USE A NON SYSTEM USER**, (i.e. with a uid/gid above 1000) to run the SuEXEC process, which is defined in the Apache VHost configuration file hereunder. Otherwise you might get an error of type: "cannot run as forbidden uid".\\ | ||
+ | Please note that this might imply changing the user and group used to run Apache itself which can be configured in the **/etc/apache2/apache2.conf** file. | ||
+ | |||
+ | Also the rights on /var/lib/apache2/fcgid/sock might need to be updated. | ||
+ | |||
+ | To monitor SuEXEC errors, check the **/var/log/apache/suexec.log** file | ||
</WRAP> | </WRAP> | ||
Line 162: | Line 190: | ||
sudo nano /etc/apache2/sites-available/domain.conf | sudo nano /etc/apache2/sites-available/domain.conf | ||
- | <VirtualHost *> | + | <VirtualHost *:80> |
ServerName domain | ServerName domain | ||
ServerAlias domain | ServerAlias domain | ||
ServerAdmin webmaster@domain | ServerAdmin webmaster@domain | ||
- | DocumentRoot /var/www/domain/web/ | + | DocumentRoot /var/www/sites/domain/web/ |
<IfModule mod_fcgid.c> | <IfModule mod_fcgid.c> | ||
- | SuexecUserGroup <username> www-pub | + | SuexecUserGroup suexec suexec |
#PHP_Fix_Pathinfo_Enable 0 | #PHP_Fix_Pathinfo_Enable 0 | ||
- | <Directory /var/www/domain/web/> | + | <Directory /var/www/sites/domain/web/> |
Options +ExecCGI | Options +ExecCGI | ||
AllowOverride All | AllowOverride All | ||
AddHandler fcgid-script .php | AddHandler fcgid-script .php | ||
- | FcgidWrapper /var/www/php-fcgid/php-cgi-5.3.4 .php | + | FcgidWrapper /var/www/php-fcgid/php-cgi-5.4.4 .php |
Order allow,deny | Order allow,deny | ||
Allow from all | Allow from all | ||
Line 181: | Line 209: | ||
</IfModule> | </IfModule> | ||
- | # ErrorLog /var/log/apache2/error.logĀ | + | ErrorLog /var/www/sites/domain/log/error.logĀ |
- | # CustomLog /var/log/apache2/access.log combined | + | CustomLog /var/www/sites/domain/log/access.log combined |
ServerSignature Off | ServerSignature Off | ||
- | |||
</VirtualHost> | </VirtualHost> | ||
</code> | </code> | ||
- | === edit hosts file to respond localy === | + | === edit hosts file on your development machine to respond localy === |
For each "domain" that you define in the config files, edit your **/etc/hosts** file, adding the domain names like this: | For each "domain" that you define in the config files, edit your **/etc/hosts** file, adding the domain names like this: | ||
<code> | <code> |