capodieci
Forum Replies Created
-
Hello everyone!
I have thumbnails generation problem using with WordPress 3.5 and NextGen Gallery 1.9.9
I have a WPMU installation (I manage many websites with a single wordpress installation) and I have thumbnail generation problem only in some websites. I did try to deactivate all the plugins, but the problem persists. The only thing that changes from one website to the other is the theme, and I did try to switch the theme with the standard theme, but no difference.
The only problem that affect all the websites is the visualization of an image using
websiteexample.com/wp-content/plugins/nextgen-gallery/nggshow.php?pid=3&width=350&height=350
as this return a broken image. This affects, for example the possibility to edit a thumbnail (as the image on the left, in the dialog, does not appears). I did extensive search, but I found no solution.Regarding the generation of the thumbnails I get the error “A failure occurred” and pressing on “more” it reads “Error: Create image failed. Check Safe Mode settings”. It cannot be the safe mode, as php.ini affects all the websites, and not just some. I searched about this, but found nothing.
Looking at the error logs of my web server I found this:
”Warning: imagecreatetruecolor(): Invalid image dimensions in xxx\wp-content\plugins\nextgen-gallery\lib\gd.thumbnail.inc.php on line 555” and ”Warning: imagecopyresampled(): supplied argument is not a valid Image resource in xxx\wp-content\plugins\nextgen-gallery\lib\gd.thumbnail.inc.php on line 940”Anyone has some idea on how to solve this problem?
Hello! I have thumbnails generation problem using with WordPress 3.5 and NextGen Gallery 1.9.9
I have a WPMU installation (I manage many websites with a single wordpress installation) and I have thumbnail generation problem only in some websites. I did try to deactivate all the plugins, but the problem persists. The only thing that changes from one website to the other is the theme, and I did try to switch the theme with the standard theme, but no difference.
The only problem that affect all the websites is the visualization of an image using
websiteexample.com/wp-content/plugins/nextgen-gallery/nggshow.php?pid=3&width=350&height=350
as this return a broken image. This affects, for example the possibility to edit a thumbnail (as the image on the left, in the dialog, does not appears). I did extensive search, but I found no solution.Regarding the generation of the thumbnails I get the error “A failure occurred” and pressing on “more” I read “Error: Create image failed. Check Safe Mode settings”. It cannot be the safe mode, as php.ini affects all the websites, and not just some. I searched about this, but found nothing.
Looking at the error logs of my web server I found this:
”Warning: imagecreatetruecolor(): Invalid image dimensions in xxx\wp-content\plugins\nextgen-gallery\lib\gd.thumbnail.inc.php on line 555” and ”Warning: imagecopyresampled(): supplied argument is not a valid Image resource in xxx\wp-content\plugins\nextgen-gallery\lib\gd.thumbnail.inc.php on line 940”Anyone has some idea on how to solve this problem?
I have thumbnails generation problem using with WordPress 3.5 and NextGen Gallery 1.9.9
I have a WPMU installation (I manage many websites with a single wordpress installation) and I have thumbnail generation problem only in some websites. I did try to deactivate all the plugins, but the problem persists. The only thing that changes from one website to the other is the theme, and I did try to switch the theme with the standard theme, but no difference.
The only problem that affect all the websites is the visualization of an image using
websiteexample.com/wp-content/plugins/nextgen-gallery/nggshow.php?pid=3&width=350&height=350
as this return a broken image. This affects, for example the possibility to edit a thumbnail (as the image on the left, in the dialog, does not appears). I did extensive search, but I found no solution.Regarding the generation of the thumbnails I get the error “A failure occurred” and pressing on “more” i read “Error: Create image failed. Check Safe Mode settings”. It cannot be the safe mode, as php.ini affects all the websites, and not just some. I searched about this, but found nothing.
Looking at the error logs of my web server I found this:
”Warning: imagecreatetruecolor(): Invalid image dimensions in xxx\wp-content\plugins\nextgen-gallery\lib\gd.thumbnail.inc.php on line 555” and ”Warning: imagecopyresampled(): supplied argument is not a valid Image resource in xxx\wp-content\plugins\nextgen-gallery\lib\gd.thumbnail.inc.php on line 940”Anyone has some idea on how to solve this problem?
Forum: Networking WordPress
In reply to: Media Library and pics in WPMU doesn't work@longtailrider that link saved my sanity!
I have WP multisite with subdomain setup and domain mapping.
I spent one day trying any kind of hack in the .htaccess file and in the httpd.conf of the server, no solution. I could access the files with no problem when using the full URL (wp-content/blogs.dir/etc) but not in any other way.
I guessed was the ms-files.php having a problem, as it was returning an empty image, while if the name of the file was incorrect would return a 404 – file not found error.
That made me understand that the file was reached, but had just a problem to be delivered to the client. That simple patch should be put in the default setup of WP as my test are in a unused website (no traffic at all) so it is not a matter of a lot of traffic on the website that causes the problem.
Hi Andrea (sei Italiano?),
in my httpd.conf I include the virtual hosts. The one for the WPMU goes like this:<VirtualHost *:80> ServerName wpmudomain.com ServerAlias *.domain1.com domain1.com *.altdomain1.com altdomain1.com ServerAlias *.domain2.com domain2.com *.altdomain2.com altdomain2.com ServerAlias *.domain3.com domain3.com *.altdomain3.com altdomain3.com ServerAdmin [email protected] DocumentRoot /home/wpmudomain.com/www <Directory /home/wpmudomain.com/www/> php_admin_flag safe_mode Off AllowOverride FileInfo Options Order allow,deny Allow from all </Directory> ErrorLog /var/log/apache2/wpmudomain.com-error.log LogLevel warn CustomLog /var/log/apache2/wpmudomain.com.com-accesslog combined </VirtualHost>
In this way every time I have a new domain with its alternate domains I add a line of server alias with them set with both wildcard and without, so that they are directed to the correct virtualhost no matter what domain is used and how the request is done (if someone arrives with https://www.domain1.com or simply domain1.com or even asfgafsdf.domain1.com it goes straight as it called to the virtualhost).
If the website uses just one domain, then I usually add a rewrite rule:
<IfModule mod_rewrite.c> RewriteEngine On RewriteOptions inherit RewriteCond %{HTTP_HOST} !^www\.domain1\.com$ [NC] RewriteRule .? https://www.domain1.com%{REQUEST_URI} [R=301,L] </IfModule>
this creates a redirect so that if the request is collected by the virtualhost directive (as the domain is in the domain alias), it redirect the visitor to the domain that I want, formatted as I want (in the example above adding www to the domain, no matter what 3rd level domain or what 2nd level domain the virtualhost is accessed with).
I cannot do this with WPMU as it would not let many different domains to be used for different WP sites in the same installation. I could edit the rewrite rule so that it just polish the 3rd level domain from the request, but this may cause problems if I want to use in wp a 3rd level domain for a site without a domain mapping used on it (for example sitex.wpmudomain.com).
Would be amazing if I can map a domain in WP saying *.domain1.com, but I did try that and not only creates problems (I guess the plugin doesn’t filter well the strings, and the array of domains consider *.domain.com as domain.com giving problem in the list visualized and in the way they are managed – delete, edit, etc), but it doesn’t work.
Considering that most users do not even have root access to their servers, or do not know how to edit apache/iis configuration files, I believe the best solution (considered that it is possible) would be implementing this possibilities in the plugin!
Cheers,
RobI solved this problem editing sunrise.php
My need is this: I have domains that begins with the number zero (example 0domain.com) so I can have URLS that look like https://www.web2.0domain.com).
My problem is that the plugin for domain mappings does not support wildcards (actually when mapping a domain as *.domain.com it creates some problems on the way the plugin display and handle the mappings) so every time I was trying to go to https://www.web2.0domain.com I was redirected to the registration page to register the new blog!
I believe my solution solves also your problem, as when the WP installation is accessed with whatever domain, my editing to sunrise.php just takes in consideration the second level domain, and ignores whatever comes before it. So in the plugin I just need to map the domain without www or anything else, and the mapping works on the second level domain (example arriving to WP with https://www.web2.0domain.com uses the mapping for 0domain.com ignoring whatever comes before it).
ATTENTION: I saw users trying to using the domain mapping plugin to redirect 3rd level domain names to specific blogs (example site1.domain.com goes to blog1 and site2.domain.com goes to blog2). Using this edit will make that not possible! In that case the changes need to be edited so the 3rd level is considered, and not the 2nd level only!
sunrise.php:
<?php if ( !defined( 'SUNRISE_LOADED' ) ) define( 'SUNRISE_LOADED', 1 ); if ( defined( 'COOKIE_DOMAIN' ) ) { die( 'The constant "COOKIE_DOMAIN" is defined (probably in wp-config.php). Please remove or comment out that define() line.' ); } $wpdb->dmtable = $wpdb->base_prefix . 'domain_mapping'; $dm_domain = get_2nd_level_name(); $where = $wpdb->prepare( 'domain = %s', $dm_domain ); $wpdb->suppress_errors(); $domain_mapping_id = $wpdb->get_var( "SELECT blog_id FROM {$wpdb->dmtable} WHERE {$where} ORDER BY CHAR_LENGTH(domain) DESC LIMIT 1" ); $wpdb->suppress_errors( false ); if( $domain_mapping_id ) { $current_blog = $wpdb->get_row("SELECT * FROM {$wpdb->blogs} WHERE blog_id = '$domain_mapping_id' LIMIT 1"); $current_blog->domain = $_SERVER[ 'HTTP_HOST' ]; $current_blog->path = '/'; $blog_id = $domain_mapping_id; $site_id = $current_blog->site_id; define( 'COOKIE_DOMAIN', $_SERVER[ 'HTTP_HOST' ] ); $current_site = $wpdb->get_row( "SELECT * from {$wpdb->site} WHERE id = '{$current_blog->site_id}' LIMIT 0,1" ); $current_site->blog_id = $wpdb->get_var( "SELECT blog_id FROM {$wpdb->blogs} WHERE domain='{$current_site->domain}' AND path='{$current_site->path}'" ); define( 'DOMAIN_MAPPING', 1 ); } function get_2nd_level_name( $url ) { static $doubleTlds = array( 'co.uk', 'me.uk', 'net.uk', 'org.uk', 'sch.uk', 'ac.uk', 'gov.uk', 'nhs.uk', 'police.uk', 'mod.uk', 'asn.au', 'com.au', 'net.au', 'id.au', 'org.au', 'edu.au', 'gov.au', 'csiro.au', 'br.com', 'com.cn', 'com.tw', 'cn.com', 'de.com', 'eu.com', 'hu.com', 'idv.tw', 'net.cn', 'no.com', 'org.cn', 'org.tw', 'co.id', 'or.id', 'ne.id', 'qc.com', 'ru.com', 'sa.com', 'se.com', 'se.net', 'uk.com', 'uk.net', 'us.com', 'uy.com', 'za.com' ); $url = trim( $url ); if ( empty( $url ) || '/' == $url[0] ) {$url = $_SERVER['HTTP_HOST'] . $url;} if ( FALSE === strpos( $url, '://' ) ) {$url = 'https://' . $url;} if ( $host = parse_url( $url, PHP_URL_HOST ) ) { if ( preg_match( '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $host ) ) {return $host;} $host = strtolower( $host ); $parts = explode( '.', $host ); if ( ! isset( $parts[1] ) ) {return $parts[0];} $tld = array_pop( $parts ); $host = array_pop( $parts ) . '.' . $tld; if ( ! empty( $parts ) && in_array( $host, $doubleTlds ) ) {$host = array_pop( $parts ) . '.' . $host;} return $host; } return FALSE; } ?>