51Testing软件测试论坛

标题: 我自己的PHPWind论坛搭建好了,欢迎体验!(lsekfe来的话最好) [打印本页]

作者: 如来佛祖    时间: 2023-1-14 16:09
标题: 我自己的PHPWind论坛搭建好了,欢迎体验!(lsekfe来的话最好)
本帖最后由 如来佛祖 于 2023-1-14 16:16 编辑

我自己的PHPWind论坛搭建好了,欢迎体验!(lsekfe来的话最好)
网址:127.0.0.1:1656
作者: 如来佛祖    时间: 2023-1-14 18:09
截图:
[attach]146027[/attach]




作者: applepen    时间: 2023-1-14 21:48
得整个服务器和域名啊。 不然公网没法访问。截图zip里是啥啊?
作者: 如来佛祖    时间: 2023-1-15 07:26
applepen 发表于 2023-1-14 21:48
得整个服务器和域名啊。 不然公网没法访问。截图zip里是啥啊?

我根本访问不了我的公网IP
作者: 如来佛祖    时间: 2023-1-15 07:26
applepen 发表于 2023-1-14 21:48
得整个服务器和域名啊。 不然公网没法访问。截图zip里是啥啊?

截图.zip里是我的论坛截图(前台+后台)
作者: 梦想家    时间: 2023-1-16 09:48
谁来了也访问不了啊127的ip
作者: 如来佛祖    时间: 2023-1-23 15:14
梦想家 发表于 2023-1-16 09:48
谁来了也访问不了啊127的ip

我的Apache是Online Mode,公网IP是101.86.110.234,可是我的公网IP无法访问,提示连接超时
作者: 如来佛祖    时间: 2023-1-23 15:20
现在我打算做个维基
可是PHP报错,浏览器直接错误500
我用的是开源的wiki
报错内容:
[Sun Jan 22 10:24:08.539383 2023] [:error] [pid 2912:tid 948] [client 127.0.0.1:7124] PHP Parse error:  syntax error, unexpected '?' in D:\\Wiki\\lib\\mb_extends\\mb_extends.php on line 66
大佬们求解答
报错文件代码:

  1. <?php

  2. /*
  3. * additional multibyte string functions used throughout wackowiki
  4. */

  5. if (!defined('IN_WACKO'))
  6. {
  7.         exit;
  8. }

  9. // taken from [url]https://www.php.net/manual/en/function.wordwrap.php#107570[/url]
  10. function utf8_wordwrap($string, $width = 75, $break = "\n", $cut = false)
  11. {
  12.         if ($cut)
  13.         {
  14.                 // Match anything 1 to $width chars long followed by whitespace or EOS,
  15.                 // otherwise match anything $width chars long
  16.                 $search                = '/(.{1,' . $width . '})(?:\s|$)|(.{' . $width . '})/uS';
  17.                 $replace        = '$1$2' . $break;
  18.         }
  19.         else
  20.         {
  21.                 // Anchor the beginning of the pattern with a lookahead
  22.                 // to avoid crazy backtracking when words are longer than $width
  23.                 $search                = '/(?=\s)(.{1,' . $width . '})(?:\s|$)/uS';
  24.                 $replace        = '$1' . $break;
  25.         }

  26.         return preg_replace($search, $replace, $string);
  27. }

  28. // taken from phputf8 [url]https://sourceforge.net/projects/phputf8/[/url]

  29. /**
  30. * UTF-8 aware replacement for ltrim()
  31. * Note: you only need to use this if you are supplying the charlist
  32. * optional arg and it contains UTF-8 characters. Otherwise ltrim will
  33. * work normally on a UTF-8 string
  34. * @see [url]https://www.php.net/ltrim[/url]
  35. * @return string
  36. */
  37. function utf8_ltrim($str, $charlist = false)
  38. {
  39.         if ($charlist === false)
  40.         {
  41.                 return ltrim($str);
  42.         }

  43.         //quote charlist for use in a characterclass
  44.         $charlist = preg_replace('!([\\\\\\-\\]\\[/^])!', '\\\${1}', $charlist);

  45.         return preg_replace('/^[' . $charlist . ']+/u', '', $str);
  46. }

  47. /**
  48. * UTF-8 aware replacement for rtrim()
  49. * Note: you only need to use this if you are supplying the charlist
  50. * optional arg and it contains UTF-8 characters. Otherwise rtrim will
  51. * work normally on a UTF-8 string
  52. * @see [url]https://www.php.net/rtrim[/url]
  53. * @return string
  54. */
  55. function utf8_rtrim($str, $charlist = false)
  56. {
  57.         $str ??= '';

  58.         if ($charlist === false)
  59.         {
  60.                 return rtrim($str);
  61.         }

  62.         //quote charlist for use in a characterclass
  63.         $charlist = preg_replace('!([\\\\\\-\\]\\[/^])!', '\\\${1}', $charlist);

  64.         return preg_replace('/[' . $charlist . ']+$/u', '', $str);
  65. }

  66. /**
  67. * Replacement for str_pad. $pad_str may contain multi-byte characters.
  68. * @param string $input
  69. * @param int $length
  70. * @param string $pad_str
  71. * @param int $type ( same constants as str_pad )
  72. * @return string
  73. * @see [url]https://www.php.net/str_pad[/url]
  74. */
  75. function utf8_str_pad($input, $length, $pad_str = ' ', $type = STR_PAD_RIGHT)
  76. {
  77.         $input_len = mb_strlen($input);

  78.         if ($length <= $input_len)
  79.         {
  80.                 return $input;
  81.         }

  82.         $pad_strlen        = mb_strlen($pad_str);
  83.         $pad_len        = $length - $input_len;

  84.         if ($type == STR_PAD_RIGHT)
  85.         {
  86.                 $repeat_times = ceil($pad_len / $pad_strlen);

  87.                 return mb_substr($input . str_repeat($pad_str, $repeat_times), 0, $length);
  88.         }

  89.         if ($type == STR_PAD_LEFT)
  90.         {
  91.                 $repeat_times = ceil($pad_len / $pad_strlen);

  92.                 return mb_substr(str_repeat($pad_str, $repeat_times), 0, floor($pad_len)) . $input;
  93.         }

  94.         if ($type == STR_PAD_BOTH)
  95.         {
  96.                 $pad_len/= 2;
  97.                 $pad_amount_left        = floor($pad_len);
  98.                 $pad_amount_right        = ceil($pad_len);
  99.                 $repeat_times_left        = ceil($pad_amount_left / $pad_strlen);
  100.                 $repeat_times_right        = ceil($pad_amount_right / $pad_strlen);

  101.                 $padding_left                = mb_substr(str_repeat($pad_str, $repeat_times_left), 0, $pad_amount_left);
  102.                 $padding_right                = mb_substr(str_repeat($pad_str, $repeat_times_right), 0, $pad_amount_left);

  103.                 return $padding_left . $input . $padding_right;
  104.         }

  105.         trigger_error('utf8_str_pad: Unknown padding type (' . $type . ')',E_USER_ERROR);
  106. }

  107. /**
  108. * UTF-8 aware replacement for trim()
  109. * Note: you only need to use this if you are supplying the charlist
  110. * optional arg and it contains UTF-8 characters. Otherwise trim will
  111. * work normally on a UTF-8 string
  112. * @see [url]https://www.php.net/trim[/url]
  113. * @return string
  114. */
  115. function utf8_trim($str, $charlist = false)
  116. {
  117.         if ($charlist === false)
  118.         {
  119.                 return trim($str);
  120.         }

  121.         return utf8_ltrim(utf8_rtrim($str, $charlist), $charlist);
  122. }

  123. /**
  124. * UTF-8 aware alternative to ucfirst
  125. * Make a string's first character uppercase
  126. * @param string $str
  127. * @return string with first character as upper case (if applicable)
  128. */
  129. function utf8_ucfirst($str)
  130. {
  131.         switch (mb_strlen($str))
  132.         {
  133.                 case 0:
  134.                         return '';
  135.                 case 1:
  136.                         return mb_strtoupper($str);
  137.                 default:
  138.                         preg_match('/^(.)(.*)$/us', $str, $matches);
  139.                         return mb_strtoupper($matches[1]) . $matches[2];
  140.         }
  141. }

  142. /**
  143. * UTF-8 aware alternative to ucwords
  144. * Uppercase the first character of each word in a string
  145. * Note: requires utf8_substr_replace
  146. * @param string
  147. * @return string with first char of each word uppercase
  148. * @see [url]https://www.php.net/ucwords[/url]
  149. */
  150. function utf8_ucwords($str)
  151. {
  152.         // Note: [\x0c\x09\x0b\x0a\x0d\x20] matches;
  153.         // form feeds, horizontal tabs, vertical tabs, linefeeds and carriage returns
  154.         // This corresponds to the definition of a "word" defined at [url]http://www.php.net/ucwords[/url]
  155.         $pattern = '/(^|([\x0c\x09\x0b\x0a\x0d\x20]+))([^\x0c\x09\x0b\x0a\x0d\x20]{1})[^\x0c\x09\x0b\x0a\x0d\x20]*/u';

  156.         return preg_replace_callback($pattern, 'utf8_ucwords_callback', $str);
  157. }

  158. /**
  159. * Callback function for preg_replace_callback call in utf8_ucwords
  160. * You don't need to call this yourself
  161. * @param array of matches corresponding to a single word
  162. * @return string with first char of the word in uppercase
  163. */
  164. function utf8_ucwords_callback($matches)
  165. {
  166.         $leadingws        = $matches[2];
  167.         $ucfirst        = mb_strtoupper($matches[3]);
  168.         $ucword                = utf8_substr_replace(ltrim($matches[0]),$ucfirst,0,1);

  169.         return $leadingws . $ucword;
  170. }

  171. /**
  172. * UTF-8 aware substr_replace.
  173. */
  174. function utf8_substr_replace($str, $repl, $start , $length = null )
  175. {
  176.         preg_match_all('/./us', $str, $ar);
  177.         preg_match_all('/./us', $repl, $rar);

  178.         if ($length === null)
  179.         {
  180.                 $length = mb_strlen($str);
  181.         }

  182.         array_splice($ar[0], $start, $length, $rar[0]);

  183.         return implode('', $ar[0]);
  184. }

  185. /**
  186. * UTF-8 aware count_chars.
  187. * @see [url]http://www.php.net/count_chars[/url]
  188. * taken from [url]https://www.php.net/manual/en/function.count-chars.php#118726[/url]
  189. */
  190. function utf8_count_chars($string, $mode = 0)
  191. {
  192.         $result =  array_fill(0, 256, 0);

  193.         for ($i = 0, $size = mb_strlen($string); $i < $size; $i++)
  194.         {
  195.                 $char = mb_substr($string, $i, 1);
  196.                 if (strlen($char) > 1)
  197.                 {
  198.                         continue;
  199.                 }

  200.                 $code = ord($char);
  201.                 if ($code >= 0 && $code <= 255)
  202.                 {
  203.                         $result[$code]++;
  204.                 }
  205.         }

  206.         switch ($mode)
  207.         {
  208.                 case 1: // same as 0 but only byte-values with a frequency greater than zero are listed.
  209.                         foreach ($result as $key => $value)
  210.                         {
  211.                                 if ($value == 0)
  212.                                 {
  213.                                         unset($result[$key]);
  214.                                 }
  215.                         }
  216.                         break;
  217.                 case 2: // same as 0 but only byte-values with a frequency equal to zero are listed.
  218.                         foreach ($result as $key => $value)
  219.                         {
  220.                                 if ($value > 0)
  221.                                 {
  222.                                         unset($result[$key]);
  223.                                 }
  224.                         }
  225.                         break;
  226.                 case 3: // a string containing all unique characters is returned.
  227.                         $build_string = '';
  228.                         foreach ($result as $key => $value)
  229.                         {
  230.                                 if ($value > 0)
  231.                                 {
  232.                                         $build_string .= chr($key);
  233.                                 }
  234.                         }
  235.                         return $build_string;
  236.                 case 4: // a string containing all not used characters is returned.
  237.                         $build_string = '';
  238.                         foreach ($result as $key => $value)
  239.                         {
  240.                                 if ($value == 0)
  241.                                 {
  242.                                         $build_string .= chr($key);
  243.                                 }
  244.                         }
  245.                         return $build_string;
  246.         }

  247.         // change key names...
  248.         foreach ($result as $key => $value)
  249.         {
  250.                 $result[chr($key)] = $value;
  251.                 unset($result[$key]);
  252.         }

  253.         return $result;
  254. }

  255. /**
  256. * UTF-8 aware replacement for str_word_count()
  257. * Counts number of words in the UTF-8 string
  258. * @param    string $string The input string
  259. * @return   int The number of words in the string
  260. * @see [url]https://www.php.net/str_word_count[/url]
  261. */
  262. function utf8_word_count($string)
  263. {
  264.         $string        = preg_replace( '/[^\\p{L}\\p{Nd}\-_]+/u' , '-' , $string );
  265.         $string        = trim( $string , '_-' );

  266.         return count( explode( '-' , $string ) );
  267. }
复制代码

PHP版本是5.6.5
系统是Win7 Pro x86
我用的是Apache2_4服务器
已经在官网上报了错误
大佬们求解答~

作者: 如来佛祖    时间: 2023-1-23 17:14
现在能够访问了,但是管理面板无法打开,报错:
The site is temporarily unavailable due to system maintenance. Please try again later.
求回答~~
作者: 如来佛祖    时间: 2023-1-24 20:56
51testing的速度永远比不上官网论坛
现在有全部都好了




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2