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

Why are functions in cakephp 3.x controllers and tables public but functions in entities protected?
Instead of image file, I get the word “array” [duplicate]
Deactivate WooCommerce shop base
Php Date Conversion change
hhvm extension loaded but can't find function
Session being closed unexpectedly?
Order by a SQL left join on another left join
novice needs process array in class more efficiently
Really struggling with Paypal IPN
Woocommerce new product to external database using API
How to pass this code to codeigniter
Codeigniter distinct query not working
PHP: access to method of object with private constructor
Model id is overridden by related model
PHP video Uploaded file shows Black screen while playing
ACF (Wordpress) the_field doesn't work

Categories

HOME
openxml
seedstack
compilation
theano
initialization
android-emulator
consul
google-play-services
tfs2015
iptables
material-components
minecraft
graphdb
buffer
bootstrap-switch
spring-jpa
sonata
complexity-theory
asp.net-core-1.0
supervisord
temperature
hidden
rpmbuild
gmp
nullreferenceexception
parceler
pst
sharedpreferences
liferay-6.2
amazon-sns
intel
perfino
pyopencl
vuforia
web-push
introspection
sap-lumira
acrobat
react-bootstrap-table
microprocessors
openbr
dotcms
winsock
wampsharp
epplus
sca
om-next
spring-rabbitmq
pdfminer
formsauthenticationticket
selenide
microkernel
swfupload
1wire
oracle-bmcs
absolute
wysihtml5
aws-kinesis-firehose
xcglogger
hibernate-ogm
winston
aurelia-fetch-client
wikimapia
thread-exceptions
tablespace
clp
svnserve
cdo.message
bbc-micro
meld
vimperator
psd
helm
sqlbase
wso2ml
supersocket.net
actionpack
dbmigrate
prism-4
subfolder
mathematical-expressions
thoughtworks-go
lifetime
global-scope
rails-api
refit
ivalueconverter
proxy-server
pbkdf2
ggts
mp4parser
codahale-metrics
objective-c-runtime
rikulo
notin
ofstream
contextswitchdeadlock
getopt-long
word-frequency
differentiation
startupscript
grails-validation
ognl
webresponse
active-record-query
jdownloader
3270
xap
index.dat

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile