php


file_put_contents permission denied causing error writing to file


I have a text file with chmod 777 in some directory: /a/b/example.txt
I have a php script in another directory: /c/d/script.php
Calling file_put_contents in the php script gives a permission error. The file, example.txt has chmod 777 and all its parent directories have 700 or 775. I believe executable permissions should be enough for the parents.
This is the error message I get:
Warning: file_put_contents(/home/a/b/example.txt): failed to open stream: Permission denied in /home/c/d/script.php on line 103 Error writing to example.txt
I have looked around but haven't found a working solution. Hoping for some further suggestions of things to try.

Related Links

cluster markers on google maps, with MySQL and PHP
Using array_intersect with multidimesional arrays and different keys
Add Wordpress as a subdirectory / subapplication inside asp.net site
Reset page Number mpdf for footer
mysql query works in phpmyadmin but not in php script?
Quicktag auto inserted into first foreach loop item
php glob not working on localhost XAMPP
Randomised content from PHP script not refreshing on reload [duplicate]
Check WordPress login outside currrent domain
Combine two array and add value of array count
How to get field name using the improved MySQL (MySQLI)? [duplicate]
symfony doctrine custom dql
Can php recognize how a page was requested?
Symfony 3 Many To Many not saving data to ManyToMany Table
Register page returns <br/>
PHP session is not storing any data in my array

Categories

HOME
php
extjs
matrix
applescript
swi-prolog
mongoid
fogbugz
lvm
gentelella
elk-stack
clone
specifications
tfs2010
locationmanager
mpu6050
freertos
distributed-computing
mahout-recommender
async-await
synthesis
google-tasks-api
closures
wsf
jitsi
maven-surefire-plugin
data-collection
oracleforms
bitbake
openbr
premake
rspec-rails
stat
hypothesis-test
elasticsearch-aggregation
dbcc
latexml
ssi
image-registration
cordova-ios
line-intersection
gtk#
gmaps.js
annotatorjs
e
jsonix
bilinear-interpolation
nsdata
dpkg
fragmentstatepageradapter
gridbaglayout
psd
jsr363
flush
ui4j
textpattern
godeps
gluon-desktop
jnlp
360-degrees
embeddedwebserver
mobilefirst-server
createfile
tabletools
usb-flash-drive
application-blocks
compiler-flags
hyphen
infinite
unrealscript
mp4parser
pacman
jbox2d
tfs-sdk
reentrancy
arrow
exponent
dropshadow
snackjs
html-components
bucket
autobench
stretchblt
jvm-bytecode
parentid

Resources

Encrypt Message