标签 错误 下的文章

SeaCMS筛选页连载状态链接错误

V12.8版本筛选页连载状态链接错误,完结和连载中都是state=l
解决:
编辑/include/link.func.php文件第566行,找到:

case "state":    
            if($value=='全部')
            {
                $Link="/".$GLOBALS['cfg_cmspath']."search.php?".preg_replace("/\&?state\=[^\&]*/i","",$schwhere);
            }
            elseif($value=='完结')
            {
            $Link="/".$GLOBALS['cfg_cmspath']."search.php?".preg_replace("/\&?state\=[^\&]*/i","",$schwhere)."&state=w";
            }
            else
            {
            $Link="/".$GLOBALS['cfg_cmspath']."search.php?".preg_replace("/\&?state\=[^\&]*/i","",$schwhere)."&state=l";
            }
        break;

修改为:

case "state":    
            if($value=='全部')
            $Link="/".$GLOBALS['cfg_cmspath']."search.php?".preg_replace("/\&?state\=[^\&]*/i","",$schwhere);
            else
            $Link="/".$GLOBALS['cfg_cmspath']."search.php?".preg_replace("/\&?state\=[^\&]*/i","",$schwhere)."&state=".urlencode($value);
        break;

SeaCMS播放地址中包含中文时解码错误导致无法播放

播放地址中包含中文时,正则获取到的内容可能是encodeURI编码后的,直接使用unescape解码会导致中文字符乱码而无法正常播放。
编辑/js/player/dplayer/dplayer.html文件,找到

if(r != null) return unescape(r[2]);

替换为:

if(r != null && r[2] !== undefined) return r[2].includes('%') ? decodeURI(r[2]) : unescape(r[2]);

根据播放地址字符串自动判断使用decodeURI或unescape解码。

Let's Encrypt_openssl.so: undefined symbol: OPENSSL_sk_num错误解决

Let's Encrypt会自动安装在用户宿主目录~/.local/下,今天在续期证书时报错:

Creating virtual environment...
Installing Python packages...
Installation succeeded.
Traceback (most recent call last):
  File "/root/.local/share/letsencrypt/bin/letsencrypt", line 7, in <module>
    from certbot.main import main
  File "/root/.local/share/letsencrypt/lib/python2.7/site-packages/certbot/main.py", line 13, in <module>
    from acme import jose
  File "/root/.local/share/letsencrypt/lib/python2.7/site-packages/acme/jose/__init__.py", line 37, in <module>
    from acme.jose.interfaces import JSONDeSerializable
  File "/root/.local/share/letsencrypt/lib/python2.7/site-packages/acme/jose/interfaces.py", line 9, in <module>
    from acme.jose import util
  File "/root/.local/share/letsencrypt/lib/python2.7/site-packages/acme/jose/util.py", line 5, in <module>
    import OpenSSL
  File "/root/.local/share/letsencrypt/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/root/.local/share/letsencrypt/lib/python2.7/site-packages/OpenSSL/rand.py", line 12, in <module>
    from OpenSSL._util import (
  File "/root/.local/share/letsencrypt/lib/python2.7/site-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/root/.local/share/letsencrypt/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 14, in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: /root/.local/share/letsencrypt/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so: undefined symbol: OPENSSL_sk_num

原因是pip编译安装相应模块时调用到系统的openssl库,而系统openssl不支持OPENSSL_sk_num

由于我之前已经编译过新版的openssl放在/usr/local/openssl下,将第一步自动安装上的openssl-devel包删除,然后pip重新安装cryptographypyopenssl即可。注意:需先清除安装缓存目录,否则安装时不会重新编译。

yum remove openssl-devel
cd ~/.local/share/letsencrypt/bin/
pip uninstall cryptography pyopenssl -y
pip install --upgrade pip
rm -rf ~/.cache/
pip install cryptography pyopenssl
ldd ~/.local/share/letsencrypt/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so

此时已经链接到编译的openssl库上,这样再执行命令便不会报错。

transmission常见错误和解决方法

1、编译安装时的错误

make[1]: *** [blocklist-test] Error 1 make[1]: Leaving directory `/root/transmission-2.5.0/libtransmission’ make: *** [all-recursive] Error 1

解决方法:

./configure --prefix=/usr

修改为:

./configure --prefix=/usr CFLAGS=-liconv

ini_set(

今天在查看messages日志文件时,发现存在大量的错误:

Jan  4 14:41:08 myhost suhosin[954]: ALERT - script tried to disable memory_limit by setting it to a negative value -1 bytes which is not allowed (attacker '110.75.173.*', file '/home/wwwroot/2dan.cc/index.php', line 5)

后来发现原因是:index.php文件中有这么一行:

// 取消内存限制
ini_set("memory_limit",'-1');

而php.ini中

memory_limit = 128M

解决方法:

  1. 删除index.php中的

    ini_set("memory_limit",'-1');

  2. 将二处的值改为相同。
  3. 卸载 suhosin
  4. 修改php.ini

    memory_limit = -1

不推荐4,原因是可能内存会被吃光。