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

Hosting with ODBC for php
PHP: File Transfer like Apache Commons http client [duplicate]
Laravel BelongsTo Relation Existance
preg_match to check if string has specific structure
GoogleAnalytics doesn't catch my domain as referrer but browsers does
Send and Receive json data from api
Laravel composer.json parse error
How to create a Cakephp 3 Shell that overwrites files without asking permission
How to write a specific regular expression? [duplicate]
Why readline_info('line_buffer') is empty?
How does this code to create an array in HTML accessed by PHP?
Difference between template and view in cake php
PHP wrapping in comparative if/else or switch causes error
Instagram Authentication using PHP
Connecting to Twilio Video API
openssl_verify() error while decoding firebase custom token using php-jwt library

Categories

HOME
orientdb
apache-nifi
blast
ews
plpgsql
theano
malware
google-webmaster-tools
scheduler
driver
tiff
squid
rest-assured
uima
multiple-tables
clr
workday
dashdb
backtracking
stackexchange.redis
cell
tortoisemerge
webviewclient
basex
pyspark-sql
xenapp
sql-execution-plan
cloudera-manager
ms-media-foundation
markov-chains
nppexec
assertions
twilio-php
aurelia-cli
elastica
python-sounddevice
suds
get-event-store
opal-framework
vungle-ads
minikube
docker-ucp
audio-converter
nusoap
lightning-workbench
phppgadmin
datediff
clrs
sesame
msxml
http4s
annotatorjs
petsc
oracle-fusion-apps
elastic4s
bigdecimal
dpkg
exists
xcopy
i2b2
currency-exchange-rates
psd
vim-plugin
bayesglm
highest
android-studio-import
replicaset
phpredis
deque
encryption-symmetric
cakephp-2.2
dc
relationships
nidaqmx
.htpasswd
facebook-game-groups
pbkdf2
acceptance-testing
void-pointers
asp.net-mvc-3-areas
session-0-isolation
tridion-2011
struts2-json-plugin
chronometer
image-formats
websphere-6.1
liveconnect
mmc3
qtextbrowser
drawimage
cleartype
source-code-protection
fuzzy-comparison
database-cloning
efs

Resources

Encrypt Message