我想在我的网站上缓存图像和其他文件,所以我做的是确保mod_headers和mod_expires: -
/usr/sbin/httpd -l
Run Code Online (Sandbox Code Playgroud)
然后编辑.htaccess为: -
ExpiresActive On
ExpiresDefault A0
# Set up caching on media files for 1 year (forever?)
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
ExpiresDefault A29030400
Header append Cache-Control "public"
</FilesMatch>
# Set up caching on media files for 1 week
<FilesMatch "\.(gif|jpg|jpeg|png|swf)$">
ExpiresDefault A604800
Header append Cache-Control "public"
</FilesMatch>
# Set up 2 Hour caching on commonly updated files
<FilesMatch "\.(xml|txt|html|js|css)$">
ExpiresDefault A9200
Header append Cache-Control "proxy-revalidate"
</FilesMatch>
# Force no caching for dynamic files
<FilesMatch "\.(php|htm)$">
ExpiresActive Off
Header …Run Code Online (Sandbox Code Playgroud) 我的PHP文件有问题,执行时间超过30秒.
搜索之后,我set_time_limit(0);在代码开头添加了cbut,文件仍然500 error在30秒后超时.
log: PHP Fatal error: Maximum execution time of 30 seconds exceeded in /xxx/xx/xxx.php
safe-mode : off
Run Code Online (Sandbox Code Playgroud) 在网站bbcode文本背景和大小输出中,像这样
<span style="background: #ff0000;">
text size normal
<br></br>
<br></br>
<span style="font-size: 250%">
text size big
</span>
<br></br>
<br></br>
</span>
Run Code Online (Sandbox Code Playgroud)
问题是背景将不适合文本大小
http://img11.imageshack.us/img11/7199/sdpm.png
如果我使span内联块,则背景色将位于整个框上
http://img31.imageshack.us/img31/323/d3t5.png
我知道如果我这样放置样式,背景颜色将适合文本
<span style="background: #ff0000;">
text size normal
<br></br>
<br></br>
<span style="style="background: #ff0000;"font-size: 250%">
text size big
</span>
<br></br>
<br></br>
</span>
Run Code Online (Sandbox Code Playgroud)
我的问题是从php bbcode生成的代码,用户有时会在文本大小之前选择背景色
php ×2
.htaccess ×1
apache ×1
background ×1
caching ×1
css ×1
execution ×1
font-size ×1
html ×1
mod-expires ×1
mod-headers ×1
timeout ×1