Linux Format forumsHelp, discussion, magazine feedback and more2013-09-12T10:14:10+00:00http://www.linuxformat.com/forums/feed.php?t=162412013-09-12T10:14:10+00:002013-09-12T10:14:10+00:00http://www.linuxformat.com/forums/viewtopic.php?t=16241&p=112442#p112442Tracked the problem down to a misconfigured virtual hosts file for the example site. I'd accidentally included a closing curly bracket where there shouldn't have been one.

Following another post from someone using Arch Linux I removed nginx, nginx-common, nginx-full, php5-common, php5-fmp and php5-cli. Reinstalled nginx, nginx-common, nginx-full, php5-common and php5-fmp. Now I can display the info.php page as it should be.

But if I try my own code in html it doesn't display properly. For example:

So that's strange and annoying enough. If I save the index page as index.php instead of index.html and point my browser at the localhost site (http://locahost:8080) it tries to download the file rather than displaying it.

]]>2013-09-11T15:34:55+00:002013-09-11T15:34:55+00:00http://www.linuxformat.com/forums/viewtopic.php?t=16241&p=112437#p112437Long time since I posted here.

I'm having a problem with nginx and php on ubuntu 13.04.

I'm very new to web development and php. I want to be able to read a text file (tab or comma sep) on the server using php and pass the resulting array to js for further client side processing.

In order to get nginx to play with php Google tells me I have to install php5-fpm and set this up. So I have followed a couple of web tutorials (tell you more or less the same thing) but the setup isn't working.

Relevant configurations are (note I've left out a load of stuff that's commented out in these files):

Nginx default file

Code:

server { listen 80; listen [::]:80 default_server ipv6only=on;

# Make site accessible from http://localhost/ server_name localhost;

root /usr/share/nginx/html; index index.php index.html index.htm;

location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ /index.html; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules }