Drupal: The selected file intersection.png could not be uploaded - drupal

I don't understand why I get this error when I upload images...
The selected file intersection.png could not be uploaded. The file is not a known image format.
It is just a png file, and the problem came when I moved the website on the server. On localhost everything was perfect.
1) I've deleted the "files" folder and created it again with a php script (to make the server the owner)
2) drupal automatically creates 2 folders into it (imagecache and temp) so I assume it has the privilegies to write into it.
3) I've changed the temporary folder in Settings > Filesystem from "/tmp" to "temp", since I got an error before (probably the /tmp folder on the server is not writable by drupal
thanks

http://drupal.org/project/transliteration I think this module help me in my problem related this issue.

There's a known problem with Drupal 6.15 and IIS (see http://drupal.org/node/419734). If you're on 6.15, try backing down to 6.14 until a fix is completed.

I solved it. The rewrite module is not enabled on my IIS server, so I had to change a line of code inside the imagecache.module to add "index.php?q=
return url($GLOBALS['base_url'] . '/index.php?q=' . file_directory_path() .'/imagecache/'. $presetname .'/'. $path, $args);

Related

Joomla 3.10 Error 500 Fatal error: Class 'JHtml' not found cms.php

I have installed and configured Joomla site on one of my domains (in sub folder), and it works great there, so now, I wanted to move it to original domain where it has to be, so in WHM I created new account for new domain, and moved my Joomla files and DB to new account, in config file, I've changed user and DB data, also changed path for log and temp and when I run Joomla on new domain, I get this error:
Fatal error: Class 'JHtml' not found in /home/newsite/public_html/libraries/cms.php on line 12
The line 12 in that file is:
if (!defined('JPATH_PLATFORM'))
but since it works on old domain, that should not be a problem?
Everything stayed on same server and folders and files in root directory have same permissions
I've added this code to index.php, before that I just got blank page
ini_set('display_errors','On'); error_reporting(E_ALL);

Css not loading in elgg framework

I downloaded all code and database from server and installed on local.but the css files are not loading on local. same working on server, please help!!
server image:
local image:
database settings on local
Table Name: elgg_datalists
path: C:/xampp/htdocs/elgg_backup/
dataroot: C:/xampp/htdocs/elgg_backup/data/
also,when i open any page it give me view not found error.
You need to change in another link in database in elgg_site_entity table change the path your local path
http://localhost/elgg_backup/
If it's still not work then change the base path in htaccess file to your folder path like this
RewriteBase /elgg_backup/
Hope this help you.
There is another table you need to modify called elgg_sites_entity. Change it like this.
http://localhost/elgg_backup/

How do i locate wordpress plugin directory?

I am trying to add a function from plugin 1(wp job manager) to plugin 2(woocommerce).
I have decided to do this by including the php file from plugin 1, however I am unable to locate the file directory. I have used:
include( plugin_dir_path( __FILE__ ) . 'wp-job-manager/includes/class-wp-job-manager-applications.php');
but it returns the following error:
Warning:
include(/home/content/p3pnexwpnas05_data02/78/2394078/html/wp-content/themes/listify-child/wp-job-manager/includes/class-wp-job-manager-applications.php): failed to open stream: No such file or directory in
/home/content/p3pnexwpnas05_data02/78/2394078/html/wp-content/themes/listify-child/functions.php
on line 77
Please advise me as I've been stuck on this issue for really long... Thanks!!!
Wordpress setups have a constant ABSPATH defined (look at the bottom lines of wp_config.php) which points to the full and absolute path of the Wordpress setup, so in your case echo ABSPATH; would return /home/content/p3pnexwpnas05_data02/78/2394078/html/.
For most installations, appending wp-content/plugins/ to that string would point you to your plugins directory.
However, in a Wordpress configuration one can also customize the wp-content and or plugins directory to their own preference, so building plugins on ABSPATH.'wp-content/plugins/ is not recommended. Unfortunately Wordpress simply doesn't have a get_absolute_pluginspath() function or something available. A trick would be to fetch the plugins-URL, and remove the site-URL from it, so the remaining data is wp-content/plugins/ (or whatever the user has made of it). In code:
$plugins_directory = ABSPATH.str_replace(site_url()."/","",plugins_url())."/";
Which in your case would return:
/home/content/p3pnexwpnas05_data02/78/2394078/html/wp-content/plugins/
You probably mean:
plugin_dir_path(__FILE__)
That gives you the directory path to the file that statement is in. So what that returns depends on where you run it. If you use this statement
include( plugin_dir_path(__FILE__) . 'wp-job-manager/includes/class-wp-job-manager-applications.php');
in the main plugin file for wp_job_manager (probably wp_job_manager.php), then plugin_dir_path(__FILE__) give the path of the directory that file is in (the plugin directory).
If you use it in some other file, you will need to adjust the rest of the path string accordingly.

White page when deploying Symfony2 Project

After I finished my project of symfony2 on windows I wanted to deploy it on a digitalocean server with Linux-Ubuntu OS. But there are some problems I can't figure them out. Please help me soon.
I uploaded the web folder files to folder html on server and other files (src , app , bin, vendor) to www folder. I also followed the instructions on config.php and solved the problems. But yet:
1- When I trying to type url : ip_address/app.php/ on browser a white page comes. No page and No error!
2- When I want to clear the cache in production env using the putty this error happens. ( Unable to write in the "C:/wamp/www/my-project/app/cache/prod" directory) but there is no such problem when clearing on localhost (I think this problem is because of transferring the project from windows to linux)
Please help me.
You probably have some errors (maybe cache directory).
For testing open the file web/app_dev.php and comment this:
/*if (isset($_SERVER['HTTP_CLIENT_IP'])
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|| !in_array(#$_SERVER['REMOTE_ADDR'], array('127.0.0.1', 'fe80::1', '::1'))
) {
header('HTTP/1.0 403 Forbidden');
exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}
*/
Now you can access your page via ip_address/app_dev.php/ and see errors. When you finish, don't forget to uncomment this.
If you have problems with cache, then I suggest you to upload code without cache directory. Then create this directory in the server and give it right permissions.

"public://public://user-pictures does not exist" when trying to change user profile photo path

I'm trying to change the path for the user profile pictures in a Drupal 7 installation and I'm getting the following error:
The directory public://public://user-pictures does not exist or is not
writable.
The path that I'm entering is simply "user-profiles".
I tried resetting the variable stored in the database by using the value from a new installation:
UPDATE variable
SET value=0x733A313A2231223B
WHERE name = 'user_pictures';
The update was successful but the problem remained.
Does anybody know how to correct this or where this value is stored in the database?
Thanks
user_pictures is a boolean variable, you're probably looking for user_picture_path.
Since variable values are stored in serialised PHP arrays it'll be much easier to update that path using the API:
variable_set('user_picture_path', 'user-profiles');
Similar to Clive answer, you can use drush from the command line :
drush vset user_picture_path your_path
I got the same error and am able to solve the issue.
“public://public://user-pictures does not exist” when trying to change user profile photo path."
What is did: Navigated to mysite.com/admin/config/people/accounts
in 'Picture directory' field default value was 'pictures', i have changed the directory name to my custom directory name 'prof_images' and now when i try to save the settings, i started getting the above error. I have cross checked the Directory name and permission but everything was fine.
How i solved the issue:
Navigated to Drupal core modules folder /modules/user and commented the following lines:
Blockquote
if (!file_prepare_directory($picture_path, FILE_CREATE_DIRECTORY)) {
form_set_error('user_picture_path', t('The directory %directory does not exist or is not writable.', array('%directory' => $picture_path)));
watchdog('file system', 'The directory %directory does not exist or is not writable.', array('%directory' => $picture_path), WATCHDOG_ERROR);
}
Blockquote
After clearing the cache, everything went cool.
Navigated to mysite.com/admin/config/people/accounts and set 'prof_images' as my user image directory and saved the settings. This time my settings are saved without any problem.
Then uncommented the above lines in the user module and everything worked as usual.
Hope this will help someone.
Thanks

Resources