Nginx/phpfpm not showing updated content

189 Views Asked by At

Server: ubuntu 14.04lts nginx(v1.10) server is showing older content when i have already changed the file,the changes are seen after 3-6 minutes. the document root directory is mounted from nfs share. the changes in the file is seen when i read/cat the file instantly but the same cant be seen on browser

Note: i have cleared the browser cache and phpopcache is disabled the average latency between nfs and nginx is less than 0.3ms. No caching server/client is done

below is my nfs mount options on client side

mount -t nfs
10.10.17.45:/www/public_html on /www/public_html type nfs (rw,noatime,nolock,bg,intr,tcp,actimeo=1800,addr=10.10.17.45

below is export conf in the nfs server

/www/public_html 10.10.17.40(rw,fsid=0,async,no_root_squash,no_subtree_check)

for example:- I have a file called showme.php with below content

<?php $var1="abc" echo $var1; ?> 

and if i change it to

<?php $var1="xyz" echo $var1; ?> 

this is not reflected on browser

2

There are 2 best solutions below

0
On

This was due to nfs mount option in nfs client's /etc/fstab file

actimeo=1800 

which is too long. I reduced it to

actimeo=1

and its working now.

0
On

In <?php $var1="xyz" echo $var2; ?> , you ar setting $var1 but echoing $var2