- Saved searches
- Use saved searches to filter your results more quickly
- apache PHP-FPM Unable to open primary script BO /index.php/URL #11721
- apache PHP-FPM Unable to open primary script BO /index.php/URL #11721
- Comments
- nginx — Unable to open primary script
- FastCGI: Unable to open primary script on NGinx and PHP-FPM
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apache PHP-FPM Unable to open primary script BO /index.php/URL #11721
apache PHP-FPM Unable to open primary script BO /index.php/URL #11721
Comments
I’ve search many times but i’ve not found any information , so i think this is a problem in how PS BO handle url, and maybe there is someone that can fix this on PS:
[proxy_fcgi:error] [client 127.0.0.1:44230] store.sixrace.it AH01071: Got error ‘Unable to open primary script: redirect:/index.php/catalog (No such file or directory)\n’Problem is that /index.php/* was not right interpreted from php-fpm, any one know a solution? its a bug?
Additionnal information
PrestaShop version: 1.7.2
PHP version: pgp-fpm 7.0
The text was updated successfully, but these errors were encountered:
khouloudbelguith added NMI Status: issue needs more information 1.7.2.4 Affects versions labels Dec 11, 2018
Update: i’m unable to make it working under apache php-fpm.
So after many workaround i’ve decide to apply a mixed configuration:
FO > NGINX PROXY > APACHE > PHP-FPM
BO > NGINX > PHP-FPM
on BO there is no rewrite url requirements so we can use NGINX without problme, hoping in the next release will be finally a support for NGINX out of the box.
There is any right section to share the NGINX + CACHE + PROXY + APACHE + PHP-FPM configuration for any one in the same trouble?
Hi @matteolavaggi ,
For your information, we can’t provide a Nginx support out of the box, because Nginx does not support .htaccess or anything similar. This is why we provide an example of configuration here:
https://github.com/PrestaShop/PrestaShop/blob/develop/docs/docker/nginx_fpm/prestashop-nginx/prestashop-nginx.conf 🙂
Having an Nginx proxy to serve and apache + fpm is maybe not a good idea when you can directly plug fpm to the Nginx service.
Hi dear, prestashop doesn’t work out of the box with nginx, also with the file example provided. Too many problems on rewrite, module page, backned and image. For this reason we need to use apache like back end . Also caching system of ps is something horrible and usefull — less in 2018 .
@matteolavaggi, with Nginx you can’t use htaccess files in Nginx context, you need to write your own rules.
this file is generated by prestashop but it’s because Apache allows to use it. Unlike Nginx.
You can find example here: https://github.com/PrestaShop/PrestaShop/blob/develop/docs/server_config/nginx.conf.dist
Thanks!
Hi dear, i know how work nginx and what is an .htaccess. what I can not understand is the assence of a supported and mainteined configuration file for nginx by prestashop developers. In 2018 is one of the worst supported ecommerce platform on nginx . ^^
ping @PierreRambaud what do you think?
Thanks!
As I said previously, Nginx does not work like Apache and does not understand .htaccess files (which store the configuration containing rewrite rules).
So we are not able to store the exact configuration needed for your server because you need to create a specific virtual host with your information
If you do not know what is Nginx and how it works, you need to call a professional, this is exactly what you do (I think) when you want to repair your house or your car when it becomes too complicated.
For your information, even wordpress, drupal, and joomla does not provide a file in the source to automatically configure Nginx 😉
Dear developer can create the file, customer can include in the vhosts config. 😉
Since we had no news from you for more than 30 days, I’ll close this ticket. Feel free to open another one if you can give specific details.
Thanks!
khouloudbelguith added No change required Resolution: issue closed because expected as is and removed NMI Status: issue needs more information labels Feb 6, 2019
This is how I fixed issues on Apache + php-fpm:
Edit php.ini and set
cgi.fix_pathinfo=1
Edit pool.d/www.conf and set
security.limit_extensions =
Notice that I set limit_extesions to blank, thus allowing all extensions, otherwise a path like «index.php/catalog» will throw an «Access denied» exception. BO uses different url’s like that one, without a .php extension and without using mod_rewrite rules in .htaccess (I don’t know why).
Notice: I use php-fpm for my dev environment so security is not an issue. Allowing all extensions (security.limit_extensions) on a prod env is not recommended.
Thanks for the info with cgi.fix_pathinfo. What’s the suggested way of using php-fpm from prestashop side with having security.limit_extensions = .php as it should be for productive environments?
the problem is not in the security limit extension. Is in the script you pass on php-fpm in configuration. Il giorno gio 23 mag 2019 alle ore 16:31 Andi Nitsche < notifications@github.com>ha scritto:
Thanks for the info with cgi.fix_pathinfo. What’s the suggested way of using php-fpm from prestashop side with having security.limit_extensions = .php as it should be for productive environments? Cheers Andi — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub , or mute the thread .
nginx — Unable to open primary script
I got error message: FastCGI sent in stderr: «Unable to open primary script: /home/messi/web/wordpress/index.php (No such file or directory)» while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: www.domain.com, request: «GET / HTTP/1.1», upstream: «fastcgi://unix:/var/run/php5-fpm.sock:», host: «www.domain.com here are my configuration files: /etc/php5/fpm/php.ini
cgi.fix_pathinfo=0 doc_root = user_dir = .
[global] pid = /var/run/php5-fpm.pid error_log = /var/log/php5-fpm.log include=/etc/php5/fpm/pool.d/*.conf
[www] user = www-data group = www-data listen = /var/run/php5-fpm.sock listen.owner = www-data listen.group = www-data listen.mode = 0666 pm = dynamic pm.max_children = 5 pm.start_servers = 2 pm.min_spare_servers = 1 pm.max_spare_servers = 3 chdir = / security.limit_extensions = .php .php3 .php4 .php5 php_flag[display_errors] = on php_admin_value[error_log] = /var/log/fpm-php.www.log php_admin_flag[log_errors] = on
user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events < worker_connections 1024; >http < include /etc/nginx/mime.types; server_tokens off; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; #gzip on; include /etc/nginx/sites-enabled/*; >
server < listen 80; server_name www.domain.com; root /home/messi/web/wordpress; error_log /var/log/nginx/err.wordpress.log; index index.php; location / < try_files $uri $uri/ /index.php?$args; >location = /favicon.ico < log_not_found off; access_log off; >location = /robots.txt < allow all; log_not_found off; access_log off; >location ~ /\. < deny all; >location ~* /(?:uploads|files)/.*\.php$ < deny all; >location ~ \.php$ < fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; >>
#adduser www-data messi #chown -R www-data:www-data /home/messi/web #chmod -R 664 /home/messi/web/wordpress
FastCGI: Unable to open primary script on NGinx and PHP-FPM
I am apparently not the only one with this problem, but after trying every suggested solution for couple I reached I point where I don’t know what to do. I am running Ubuntu 16.04, NGinx and PHP-FPM. The nginx.conf is the default one, I only set a more informative log format. The user rights seem to be okay: NGinx and PHP_FPM run under user www-data. Document-Root owner is www-data. FPM-Pool owner is www-data. Socket-file is there and writable. I already tried setting folder- and file-permissions to the weakest (chmod 777): No result. This is my server.conf, as you can see from commented lines, I tried a bunch of tricks — with no effect:
server < listen 8080; # listen 8080 default_server; # listen [::]:8080 default_server; server_name example.com www.example.com root /var/www/nginx/; index index.php; access_log /var/log/nginx/scripts.log scripts; gzip on; gzip_comp_level 3; gzip_types text/plain text/css application/javascript image/*; location ~ \.php$ < if ($uri !~ "^/uploads/") < fastcgi_pass unix:/run/php/php-fpm-www.sock; >include fastcgi.conf; # include snippets/fastcgi-php.conf; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; > # Block access to .htaccess location ~ \.htaccess < deny all; >>
[www] listen = /run/php/php-fpm-$pool.sock user = www-data group = www-data listen.owner = www-data listen.group = www-data php_admin_flag[allow_url_fopen] = off php_admin_flag[allow_url_include] = off php_admin_value[memory_limit] = 128M pm = dynamic pm.max_children = 5 pm.start_servers = 1 pm.min_spare_servers = 1 pm.max_spare_servers = 3 chdir = / chroot = /var/www/nginx/ php_flag[display_errors] = on php_admin_value[error_log] = /var/log/fpm-php.www.log php_admin_flag[log_errors] = on catch_workers_output = yes
/var/www/nginx/index.php > GET /index.php HTTP/1.1
2018/08/29 17:34:27 [error] 24020#24020: *47 FastCGI sent in stderr: "Unable to open primary script: /var/www/nginx/index.php (No such file or directory)" while reading response header from upstream, client: 213.61.37.18, server: example.com, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php-fpm-www.sock:", host: "example.com:8080"