$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>ftp - file compressed the content on single line after upload in wordpress|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

ftp - file compressed the content on single line after upload in wordpress

matteradmin9PV0评论

I don't have any idea what going wrong with my wordpress file, When i tried to open a file after downloading, the downloaded file got compressed in single like like:

<?php/** * The Header for our theme. * * Displays all of the <head> section and everything up till <div id="main"> *

and the actual file is like:

<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div id="main">
 *

the problem with this, when i tried to upload new files then also compressed and not working properly. I have installed WP Super Cache plugin to cache the pages for increasing the page load speed with cache, I am not sure if this plugin is behind all this.

Instead of wp super cache i have added some code in my htaccess file:

RewriteEngine On
RewriteBase /blog/

# here are few rewrite rules for 301 permanent redirect

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]


Header unset ETag  
FileETag None

<filesMatch "\.(jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, private"
Header set Expires "Sun, 23 October 2011 20:00:00 GMT"
</filesMatch>
<filesMatch "\.(css|css.gz)$">
Header set Cache-Control "max-age=604800, private"
</filesMatch>
<filesMatch "\.(js|js.gz)$">
Header set Cache-Control "max-age=604800, private"
</filesMatch>
<filesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=216000, private, must-revalidate"
</filesMatch>
<filesMatch "\.(html|htm)$">
Header set Cache-Control "max-age=7200, private, must-revalidate"
</filesMatch>

AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>

# END WordPress

Can anyone please help me what wrong i have done..

UPDATE:

I don't have any idea what going wrong with my wordpress file, When i tried to open a file after downloading, the downloaded file got compressed in single like like:

<?php/** * The Header for our theme. * * Displays all of the <head> section and everything up till <div id="main"> *

and the actual file is like:

<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div id="main">
 *

the problem with this, when i tried to upload new files then also compressed and not working properly. I have installed WP Super Cache plugin to cache the pages for increasing the page load speed with cache, I am not sure if this plugin is behind all this.

Instead of wp super cache i have added some code in my htaccess file:

RewriteEngine On
RewriteBase /blog/

# here are few rewrite rules for 301 permanent redirect

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]


Header unset ETag  
FileETag None

<filesMatch "\.(jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, private"
Header set Expires "Sun, 23 October 2011 20:00:00 GMT"
</filesMatch>
<filesMatch "\.(css|css.gz)$">
Header set Cache-Control "max-age=604800, private"
</filesMatch>
<filesMatch "\.(js|js.gz)$">
Header set Cache-Control "max-age=604800, private"
</filesMatch>
<filesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=216000, private, must-revalidate"
</filesMatch>
<filesMatch "\.(html|htm)$">
Header set Cache-Control "max-age=7200, private, must-revalidate"
</filesMatch>

AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>

# END WordPress

Can anyone please help me what wrong i have done..

UPDATE:

Share Improve this question edited Feb 8, 2019 at 23:58 fuxia 107k39 gold badges255 silver badges461 bronze badges asked Sep 28, 2013 at 18:33 jogesh_pijogesh_pi 2674 silver badges16 bronze badges 6
  • Download the file how? Open the file with what? Please be specific. – s_ha_dum Commented Sep 29, 2013 at 0:52
  • @s_ha_dum take a look on the updated question, and hope now you understand :( – jogesh_pi Commented Oct 2, 2013 at 11:56
  • My honest answer would be "Don't use the built in code editor, ever." You will have to do more debugging to fix that (conceptually flawed) editor if you really want to, though. Put your .htaccess back to default, and disable your plugins one by one, to start. – s_ha_dum Commented Oct 2, 2013 at 14:04
  • @s_ha_dum i will keep in mind for future, but all that happening after w3total_cache plugin, and after that i deleted that plugin but all these files displaying same like above, now i have just wp super cache plugin installed and i tried disabled the plugin but same compressions files.. – jogesh_pi Commented Oct 2, 2013 at 16:23
  • You mention both "W3 Total Cache" and "WP Super Cache". Which is it? Those are different plugins. – s_ha_dum Commented Oct 2, 2013 at 18:41
 |  Show 1 more comment

1 Answer 1

Reset to default 0

Caching plugins are complicated beasts. They install a number of components that other plugins typically do not. You can't just switch them off. For example, the uninstall routine for WP Super Cache is:

  1. Turn off caching on the plugin settings page and clear the cache.
  2. Deactivate the plugin on the plugins page.
  3. Remove the WP_CACHE define from wp-config.php. It looks like define( 'WP_CACHE', true );
  4. Remove the Super Cache mod_rewrite rules from your .htaccess file.
  5. Remove the files wp-content/advanced-cache.php and wp-content/wp-cache-config.php
  6. Remove the directory wp-content/cache/
  7. Remove the directory wp-super-cache from your plugins directory.

My guess is that you have not completely uninstalled one or both of the plugins and are seeing the consequences. You need to go through the uninstall instructions for the caching plugins and make sure that you get everything cleaned up properly.

Post a comment

comment list (0)

  1. No comments so far