Warning: file_put_contents error in drupal - drupal

I am getting following error when I am trying to upload an image to a block in Drupal. Could anyone help me on this?
"Warning: file_put_contents(/sites/all/modules/azexo_composer/azexo_elements/elements.js): failed to open stream: Permission denied in azexo_get_template_elements() (line 738 of /sites/all/modules/azexo_composer/azexo_composer.module)"
Thanks in Advance

you don't have permission for create file in directory.
you can create file in sites/default/files directory

Related

wordpress Error establishing a database connection, the page can not display

I am very new to Wordpress. I uploaded data to cpanel, but when I tried to borrows the link to display the website I get this message when I look at the error log.
Error establishing a database connection
There were the below two error messages. I hope somebody can help me.
PHP Warning: require(/home/.../public_html/wp-includes/load.php): failed to open stream: No such file or directory in /home/.../public_html/wp-settings.php on line 19
PHP Fatal error: require(): Failed opening required '/home/.../public_html/wp-includes/load.php' (include_path='.:/opt/cpanel/ea-php56/root/usr/share/pear') in /home/.../public_html/wp-settings.php on line 19
Most likely you have a bad (incomplete) file upload.
Try to upload again your Wordpress installation.

Fatal error: Class 'WP_Scripts' not found in wp-includes\functions.wp-scripts.php

I have to developed the new wordpress site in my localhost xammp server.
the following fatal error is shown to me Fatal error: Class 'WP_Scripts' not found in wp-includes\functions.wp-scripts.php on line 23.
how to solve this issue, pls anyone help for me.
You have to re-install wordpress again, as somefiles are missing thats why it showing this error.
Do below steps:
Copy your downloaded wordpress repository and paste it again in xamp
server
setup wordpress again
conect with db by adding db configuration
then your issue get resolved
Put this file in wp-includes folder
class.wp-scripts.php
Note: you can find this file from any new wp-setup.

Permission Denied in Sublimetext3 unix

I downloaded Sublimetext3, and tried saving a file and received "Error: Permission denied". I tried changing the Sharing and Permissions access and continue to receive the same error.
How do I fix this issue?

Prod logs in symfony 2 not using root dir

I'm developping a symfony2 website. I'm using apache2.2.
Everything works fine in dev environment.
But when i want to try it on the prod environment, it goes :
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or
file "/var/www/domain/app/logs/prod.log" could not be opened:
fopen(/var/www/domain/app/logs/prod.log) [function.fopen]: failed to open stream: No
such file or directory' in /var/www/myapp/app/cache/prod/classes.php on line 4799
Why is it trying to write in /var/www/domain since my application is in /var/www/myapp ?
I tried to modify the config_prod.yml to no result.
Any idea ?
Thanks
#Boris Guéry it was a cache problem, you were right, but i couldn't use de command line to clear it. I had to use rm -rf in the shell.
Thanks

I can't upload files after migrating a Drupal site to a new server

We have a content type with two imagefield / filefield fields, and after migrating our site to a new server, we have the following problem:
When we submit a new item for this content type, with two images for those fields, drupal gives us the following error and does not upload the images:
warning:
fopen(sites/default/files/.htaccess)
[function.fopen]: failed to open
stream: Permission denied in
/websites/sitename/data/sites/all/modules/filefield/field_file.inc
on line 349. warning:
fopen(sites/default/files/.htaccess)
[function.fopen]: failed to open
stream: Permission denied in
/websites/sitename/data/sites/all/modules/filefield/field_file.inc
on line 349. An image thumbnail was
not able to be created. warning:
fopen(sites/default/files/.htaccess)
[function.fopen]: failed to open
stream: Permission denied in
/websites/sitename/data/sites/all/modules/filefield/field_file.inc
on line 349. warning:
fopen(sites/default/files/.htaccess)
[function.fopen]: failed to open
stream: Permission denied in
/websites/sitename/data/sites/all/modules/filefield/field_file.inc
on line 349. An image thumbnail was
not able to be created.
I understand this is a permissions error, but it is not clear to me where do I have to change permissions.
Line 349 of file.inc has the following code:
if (($fp = fopen("$directory/.htaccess", 'w')) && fputs($fp, $htaccess_lines)) {
fclose($fp);
chmod($directory .'/.htaccess', 0664);
}
else {
$repl = array('%directory' => $directory, '!htaccess' => nl2br(check_plain($htaccess_lines)));
form_set_error($form_item, t("Security warning: Couldn't write .htaccess file. Please create a .htaccess file in your %directory directory which contains the following lines:<br /><code>!htaccess</code>", $repl));
*EDIT: Solved, The issue was that for some reason drupal needed write permissions in the sites/default/files folder to create a .htaccess file.
The code in file.inc wants to update/create the .htaccess file in the files directory ('sites/default/files' in your case). That it fails could mean that your web server process' do not have write permissions in the files directory at all (unlikely, as this would give more prominent errors in the backend), or that there already exists a .htaccess file in that directory which is set to read only (more likely, could have happened on migration and can easily be overlooked, as the file is hidden by default).

Resources