Welcome! Log In Create A New Profile

Advanced

Trying nginx+php+mysql on Mac OS. Failing :-(

Posted by rjalex 
Trying nginx+php+mysql on Mac OS. Failing :-(
July 07, 2017 11:32AM
Dear friends,
I installed mysql, nginx and php 7 on my Mac OS Sierra and despite working for several hours I am not quite managing to get the phpinfo to work (it gets downloaded).

As far as I understand php-fm is running

Bob@Imac27RJA:~$ lsof -Pni4 | grep LISTEN | grep php
php-fpm 4498 Bob 8u IPv4 0xdfb09ce80e670d85 0t0 TCP 127.0.0.1:9000 (LISTEN)
php-fpm 4499 Bob 0u IPv4 0xdfb09ce80e670d85 0t0 TCP 127.0.0.1:9000 (LISTEN)
php-fpm 4500 Bob 0u IPv4 0xdfb09ce80e670d85 0t0 TCP 127.0.0.1:9000 (LISTEN)

and php is v7:
Bob@Imac27RJA:~/Hosts/paperness.it$ php -v
PHP 7.0.20 (cli) (built: Jun 23 2017 07:46:30) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.20, Copyright (c) 1999-2017, by Zend Technologies
with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans

and nginx too is up and running:

Bob@Imac27RJA:~$ lsof -Pni4 | grep LISTEN | grep nginx
nginx 4740 Bob 6u IPv4 0xdfb09ce82a29ba5d 0t0 TCP *:80 (LISTEN)
nginx 4740 Bob 7u IPv4 0xdfb09ce8168cb67d 0t0 TCP *:443 (LISTEN)
... several similar lines omitted ...

my website is here:

Bob@Imac27RJA:~/Hosts/paperness.it$ ls -l
total 16
-rw-r--r-- 1 Bob staff 600B Jul 7 16:00 index.html
-rw-r--r-- 1 Bob staff 19B Jul 7 17:05 index.php

and the content of the index.php file is:

Bob@Imac27RJA:~/Hosts/paperness.it$ cat index.php
<?php phpinfo(); ?>

while the index.html file gets loaded as expected, the index.php file is only downloaded and not interpreted by PHP

Bob@Imac27RJA:~$ nginx -v
nginx version: nginx/1.12.0

here follows attached the nginx.conf file. Please help to identify my beginner's mistake ! Thank you very much in advance
Attachments:
open | download - nginx.conf (973 bytes)
Re: Trying nginx+php+mysql on Mac OS. Failing :-(
July 07, 2017 03:13PM
Guys !!! After a good dinner and getting back to analysing I found the error !!!

A backslash had crept before the $ sign in location ~ \.php$

Sorry for disturbing but still if you have good suggestions for my nginx config please shhot !

THANKS
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 148
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready