jimlongo56
Basic Pleskian
In my extension I'm trying to open and write to a file on the server.
I have the absolute path to the file ($filepath) and when I run
    
	
	
	
		
I get the following errors
	
	
	
		
I have run
	
		
I have checked that su_exec is enabled in Apache
				
			I have the absolute path to the file ($filepath) and when I run
		Code:
	
	$contents = @file_get_contents($filepath) ?: ''; 
$s = 'some string';
$file_put_contents($contents, $s);I get the following errors
		Code:
	
	PHP Warning: file_put_contents(/var/www/vhosts/jim.com/art.janis/.htaccess): failed to open stream: Permission denied
Line: 95
File: /usr/local/psa/admin/plib/modules/tcs-adpro/controllers/ClientController.php
Stack Trace:
#0  Smb_Exception_Syntax::handleError(2, file_put_contents(/var/www/vhosts/jim.com/art.janis/.htaccess): failed to open stream: Permission denied, /usr/local/psa/admin/plib/modules/tcs-adpro/controllers/ClientController.php, 95, Array ([domain] => art.janis.com,[webroot] => /var/www/vhosts/jim.com/art.janis,[htaccess_file] => /var/www/vhosts/jim.com/art.janis/.htaccess,[htaccess_contents] => ,[htaccess_start_comment] => # BEGIN comment, do not edit,[htaccess_end_comment] => # END comment, do not edit,[jsCode] => somerandomstring,[s] => # BEGIN comment, do not edit
AddOutputFilterByType SUBSTITUTE text/html
Substitute "somerandomstring|ni"
# END, do not edit,[php_errormsg] => file_get_contents(/var/www/vhosts/jim.com/art.janis/.htaccess): failed to open stream: No such file or directory))
#1  file_put_contents(/var/www/vhosts/jim.com/art.janis/.htaccess, # BEGIN comment, do not edit
AddOutputFilterByType SUBSTITUTE text/html
Substitute "somerandomstring|ni"
# END comment, do not edit) called at [/usr/local/psa/admin/plib/modules/tcs-adpro/controllers/ClientController.php:95]
#2  ClientController->htaccess_creator(art.janis.com, /var/www/vhosts/jim.com/art.janis) called at [/usr/local/psa/admin/plib/modules/tcs-adpro/controllers/ClientController.php:62]
#3  ClientController->indexAction() called at [/usr/local/psa/admin/plib/vendor/plesk/zendframework/library/Zend/Controller/Action.php:516]
#4  Zend_Controller_Action->dispatch(indexAction) called at [/usr/local/psa/admin/plib/vendor/plesk/zendframework/library/Zend/Controller/Dispatcher/Standard.php:308]
#5  Zend_Controller_Dispatcher_Standard->dispatch(Zend_Controller_Request_Http Object ([*_paramSources] => Array ([0] => _GET,[1] => _POST),[*_requestUri] => /modules/tcs-adpro/index.php/client/index?dom_id=28&site_id=31,[*_baseUrl] => /modules/tcs-adpro/index.php,[*_basePath] => ,[*_pathInfo] => /client/index,[*_params] => Array ([controller] => client,[action] => index,[module] => tcs-adpro),[*_rawBody] => ,[*_aliases] => Array (),[*_dispatched] => 1,[*_module] => tcs-adpro,[*_moduleKey] => module,[*_controller] => client,[*_controllerKey] => controller,[*_action] => index,[*_actionKey] => action), Zend_Controller_Response_Http Object ([*_body] => Array (),[*_exceptions] => Array (),[*_headers] => Array (),[*_headersRaw] => Array (),[*_httpResponseCode] => 200,[*_isRedirect] => ,[*_renderExceptions] => ,[headersSentThrowsException] => 1)) called at [/usr/local/psa/admin/plib/vendor/plesk/zendframework/library/Zend/Controller/Front.php:954]
#6  Zend_Controller_Front->dispatch() called at [/usr/local/psa/admin/plib/pm/Application.php:99]
#7  pm_Application->run() called at [/usr/local/psa/admin/htdocs/modules/tcs-adpro/index.php:11]I have run
		Code:
	
	$ plesk repair installation -y -v
$ plesk repair all -y -vI have checked that su_exec is enabled in Apache
			
				Last edited: 
			
		
	
								
								
									
	
								
							
							 
 
		 
 
		 
 
		