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

Reading all the values except 0
How to do curl in Php to trigger and send a file to jenkins job (which accepts file as parameter)
PHP mySQL Warning trying to connect to database
curl to php conversion, array + json
MySQL get rows from array
CodeIgniter + Smarty
use query builder or sql doctrine
PHP - Replacing multiple sets of placeholders while looping through arrays
404 error on REST Easy
Finding the nearest neighbor Algorithm using google map coordinates
Calculate how many lunches and dinners [closed]
how make parse in some ul?
PHP Generator Yield keyword with FTP
Get informations from an array in PHP [duplicate]
YouTube Analytics API PHP: usageLimits accessNotConfigured
MySQL Edit records using PHP

Categories

HOME
google-chrome
visual-studio
spring-data
extjs
clearcase
paypal-ipn
enums
devexpress
compilation
iverilog
typeerror
cryptography
liferay-7
elisp
tibco
ipv6
bittorrent
firebase-database
cisco
hspi
migrate
scrape
phpstorm-2017.1
asp.net-core-1.0
supervisord
nest-api
neo4j.rb
web-analytics
quantitative-finance
websphere-portal
sipp
running-object-table
miniprofiler
tsung
javax.persistence
splunk-query
locks
lxml
db2-luw
orchardcms-1.8
uivisualeffectview
oauth2
get-event-store
oauth2-playground
hypothesis-test
1wire
jshint
sonarqube5.2
cyanogenmod
django-static-precompiler
entropy
test-data
mobile-angular-ui
apache-modules
nrf51
multi-touch
tablespace
raw-sockets
conan
gridbaglayout
vimperator
trust
lovefield
juniper-network-connect
place
dsa
srv-record
bjam
enaml
utf8-decode
network-printers
roxy-fileman
meteorite
spring-security-acl
vlab
xsd2code
codahale-metrics
coalesce
quickgraph
icenium
ckeditor.net
voice-recording
viewpagerindicator
cakeyframeanimation
prefuse
boost-foreach
net-use
fork-join
uipasteboard
startupscript
libxslt
turbine
uninstaller
ixmldomdocument
principles
accumulator
motif
efs
regioninfo

Resources

Encrypt Message