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

Getting value from input select Zend Framework 3
How to call a class within other class?
array_map produces weird unicode character
Find if an array is empty in PHP
Different directories using different PHP versions?
Getting error for undefined index in CodeIgniter
Request::Secure() not work with Asset()
Symfony Class Not Found Exception in Laravel Auditing (5)
groupBy within withCount closure (Laravel 5.3.26)
Use multiple name for an input type
How to review changes before making a record go live. Laravel, PHP
Adding “Related Products” to a custom tab in WooCommerce
Other files than php files not being processed; php-fpm
File request returns error 500
Display Banner after mysql first result
spl_autoload_register couldn't get “use” namespace

Categories

HOME
livecode
bots
key
kivy
capistrano
stored-procedures
tweepy
responsive-design
buffer
jquery-file-upload
powermock
jodatime
dhcp
corona
twisted
bnf
susy-sass
http-authentication
nullreferenceexception
android-custom-view
amazon-mws
sqlplus
el
fluent-migrator
sipp
ratio
introspection
acrobat
spring-annotations
cube
materialize
basic-authentication
region
audit
source-insight
snap-framework
cucumber-junit
osx-lion
xvfb
aurelia-http-client
tidal-scheduler
resampling
pyttsx
optionaldataexception
haar-classifier
absolute
liteide
intellij-lombok-plugin
jgrapht
entropy
nslayoutconstraint
glassfish-4.1
cognos-tm1
nitrousio
portal
svnserve
system.net.mail
declarative
apache-pig-grunt
distributed-cache
univocity
enunciate
cryptojs
bayesglm
perceptron
decidable
mixins
netdatacontractserializer
google-gdk
wicked-gem
fuseesb
shell-extensions
createfile
operands
n-tier-architecture
flurry-analytics
osascript
prism.js
jchartfx
iosched
postgres-xc
.net-remoting
insertion
ofstream
handshake
simplecov
msinfo32
zotonic
hardcode
series-40
liveconnect
fitch-proofs
netstream
nosetests
azure-acs
upshot
3des
bll
gaelyk
outlook-2007-addin
sscli
getimagesize
sqlsitemapprovider
database-cloning
community-server
synthesizer

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App