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

How to get a huge array in PHP
how to import magento orders into quickbooks desktop enterpise edition using web connector?
Notice: Undefined variable: row when PDO returns no data
HTML, PHP multiple form “checkout”
How to generate dynamic tables with jquery by receiving json response from php
Nginx with CakePHP in subfolder not serving static files (CSS, JS, IMG)
Symfony2 - making a list of entities selectable
How can I select values with 0 as prefix e.g. 00-09
Scrolling does not work when browser size is reduced and header is fixed while using bootstrap
html entities being reported as something different than what the string actually has
pdo/json longtext sometimes return as null
Removing the “\ufeff” from the end of object -> content in Google+ API json result
Download part of a video with curl
REGEXP Date greater than or equal to today.
how to access returned data in ajax from php?
Problems understanding preg_match()

Categories

HOME
google-chrome
apache-nifi
automapper
gaming
verification
softlayer
code-formatting
celery
linker
gprs
firebase-database
u-boot
azure-logic-apps
lc3
xamarin-zebble
fbloginview
rangy
bootstrap-switch
mailgun
boomi
cmake-gui
jitsi
social-tables
activeadmin
mime-types
quantitative-finance
jstree
nurbs
hdmi
xdebug
gravity-forms-plugin
mdns
memory-fences
caesar-cipher
numerics
cloudera-quickstart-vm
microkernel
imgur
moinmoin
jshint
docker-ucp
axis
cyanogenmod
sonicmq
cordova-ios
portability
apache-modules
alertify
oracle-fusion-apps
xcode6.4
e
s-function
livecycle
xcode8-beta4
qtcpsocket
apache-pig-grunt
highlighting
node-glob
mercurial-extension
gridbaglayout
boost-proto
uitest
replicaset
swagger-maven-plugin
algebraixlib
angular-amd
actionpack
r.java-file
subview
fiware-bosun
n-tier-architecture
zend-mail
ecos
jini
lync-2010
jacob
dojo-1.9
linkbutton
telerik-ajax
thejit
server-name
gamesalad
prototypal-inheritance
net-use
kernel32
turbine
aptitude
ning
bindable-linq
parentid

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