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

Looking for a way to encrypt/decrypt network data between PHP and iOS
show payment details by default with paypal adaptive payments
Is there a way in PHP to capture ALL the information passed using the POST method
PHP regex with preg_match()
MongoDB Search and Save if conditions
output shell command in php
HTML Template Language for PHP
Cross language session variables & cookies
Zend Framework 2 + Doctrine 2 skeleton app
It is not deleting a database row when I click on the Cancel button
Codeigniter Search Pagination
php field with live evaluation
Can others see contents of variables in PHP?
Confirming Markdown Files
PHP SimpleXMLElement XPath Selection
PHP Unexpected T_encapsed [closed]

Categories

HOME
python-2.7
memory
generics
yahoo-weather-api
jms
paypal-ipn
transactions
tcsh
braintree
biztalk
angular-meteor
javafx-8
responsive-design
msmq
gtk
colors
orc
sonata
vertica
playframework-2.0
susy-sass
anova
sqlplus
gollum-wiki
qa
high-availability
ipa
python-appium
bitbake
splunk-query
tightvnc
publishing
python-2.x
quick-nimble
devtools
autoencoder
nsuserdefaults
nanogallery
uivisualeffectview
cheat-engine
imgur
elasticsearch-aggregation
autorelease
return-type
spring.net
subforms
word-2007
wikimapia
dblink
email-injection
ternary-operator
elastic4s
streamwriter
system.web.optimization
jsf-2.3
wininet
zynq
django-testing
android-sdcard
onepage-checkout
ibm-was
dsa
knife
espresso
swagger-maven-plugin
kotlin-android-extensions
lifetime
dnsjava
dc
inequality
webautomation
jack
boolean-algebra
mod-perl
saga
illuminate-container
progress-db
insertonsubmit
codahale-metrics
web-frameworks
cmath
jsplitpane
daap
java.lang.class
acpi
memory-pool
will-paginate
groovy-console
photo-management
mongrel2
downgrade
eaccelerator
fgetc
.net-services
facebook-fbml
html-components
3270
fxruby
rtti

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