Articles of PHP

Mediawiki不会第一次运行

我试图将Mediawiki 1.22.6安装到apache文档根目录下的子目录/wiki/目录下,其中包含一些其他的目录。 当我第一次尝试打开http://example.com/wiki或http://example.com/wiki/index.php来生成LocalSettings.php时,脚本不能运行; 相反,它的一部分被打印: bar()等等),它会在#PHP 4中抛出错误。Setup.php和ObjectCache.php在PHP 5.0和#5.1中分别具有无效的结构。 if(!function_exists('version_compare')|| version_compare(phpversion(),'5.3.2')<0){//我们需要在这里使用dirname( FILE )导致DIR是PHP5.3+ require dirname( FILE ) 。 '/includes/PHPVersionError.php'; wfPHPVersionError('index.php'); }#初始化通用代码。 这让我们可以访问GlobalFunctions,#AutoLoader和全局variables$ wgRequest,$ wgOut,$ wgUser,$ wgLang和#$ wgContLang等。 它不会加载$ wgTitle需要DIR 。 '/includes/WebStart.php'; $ mediaWiki = new MediaWiki(); $ mediaWiki->运行(); 用php -f index.php运行脚本会产生预期的输出。 没有别名或重写规则; mod_php似乎已启用 – 如果以文档根目录安装,Mediawiki将起作用。 在当前安装文件根目录是一个符号链接。 虚拟主机configuration如下: <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /home/hell/public_html <Directory /> Options FollowSymLinks […]

清漆+磅在Apache 503错误

我在Apache的Varnish + Pound设置上看到很多看似随机的503 Service Unavailable错误。 我不知道从哪里开始或者问题是什么。 我已经在网上search了一大堆,我所尝试的所有build议都没有奏效。 所以下面是我的设置。 清漆configuration DAEMON_OPTS="-a :80 \ -T localhost:6082 \ -f /etc/varnish/default.vcl \ -S /etc/varnish/secret \ -p connect_timeout=2500 \ -p thread_pools=8 \ -p thread_pool_max=2500 \ -p max_restarts=8 \ -s malloc,256m" Varnish VCL backend default { .host = "127.0.0.1"; .port = "8080"; .connect_timeout = 3600s; .first_byte_timeout = 3600s; .between_bytes_timeout = 3600s; […]

PHP APC不能增加32M以上的caching

apc.shm_size我把它设置为128M我也尝试了128(没有M) 但它总是32M 🙁 / proc / sys / kernal / shmmax设置为134217728

PHP APC共享内存过期如何工作?

我正在使用APC,看到我仍然有25MB的可用内存。 但是,在Cache full count ,我已经看到了8 。 那么,为什么会这样呢? 如果我的理解是:APC不是一个LRUcaching,那么为什么我仍然需要释放内存,因为我已经达到了全数?

什么会导致Apache返回畸形的HTTP响应?

我有一个Go服务器,反向代理请求到Apache / PHP服务器。 我很less观察到Apache / PHP服务器偶尔会导致Go产生以下错误消息: malformed HTTP response "false"错误的malformed HTTP response "false" 。 这些请求是相同的,我可以在浏览器中按照请求path坐下来刷新一个页面,并且可能有一百次错误发生。 至于什么时候会发生,我还没有观察到任何的模式。 在任何访问日志,错误日志或系统日志中都没有任何相关的东西。 我已经能够让Go用下面的代码产生错误消息,所以看起来Apache必须发送无效响应,直接将string“false”写入到TCP连接。 任何线索,这将不胜感激。 请求: package main import ( "fmt" "net/http" "net/http/httputil" ) func main() { req, _ := http.NewRequest("GET", "http://127.0.0.1:36302", nil) resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } respDump, _ := httputil.DumpResponse(resp, true) fmt.Println(string(respDump)) } […]

请求不会在使用Nginx和PHP-FPM的pm.max_children之后排队

只要池达到pm.max_children,Nginx就会在尝试向PHP-FPM发送新请求时开始超时。 “最大侦听队列”在php状态页面中始终为0。 PHP-FPM 5.5.16 Nginx 1.6.1 这里是一个php-fpm池的例子: [example] catch_workers_output = no ; Configure listener listen = /var/run/php-fpm/example.sock listen.backlog = 65535 listen.owner = nginx listen.group = nginx ; Unix user/group of processes user = nginx group = nginx ; Choose how the process manager will control the number of child processes. pm = ondemand pm.max_children = […]

Zabbix PDF报告生成

如果你有任何想法如何实现zabbix生成PDF报告? 在论坛上我发现了一些这样的: https : //www.zabbix.com/forum/showthread.php?t=24998 。 我尝试实现这个到我的zabbix 2.2.3,但是当我这样做,我仍然看到文本(无法login:)我想这是一个问题的版本。 你可以看到它只在1.8.8和1.8.10上进行了testing。 有没有人有一些想法? 一个问题是,由于API版本问题,这是失败的,我从http://zabbixapi.confirm.ch/新下载,现在我可以生成PDF报告,但是,当我select一些网站,我只看到所有选项PDF是空的 下面我分享屏幕和示例报告: http : //pl.scribd.com/doc/237807238/file-1 任何人有一些想法? 问候Mick

了解和解决Web服务器漏洞

我们最近有人联系我们的公司,指出我们有很多安全威胁可以用来利用我们的系统。 他们非常好,提供了我们现在正在研究的这些列表,但是由于我们没有特别指定安全的人,所以我正在研究这些以便更好地理解这些列表。 虽然他提供了很多,但其中一个例子如下。 我不明白的是GET中的这个URL是如何串在一起的? 在“publicservers.php”中,它只是回声数据(没有数据库连接/等),没有任何内容。 “/fonts/game-servers.php/reset.css”是如何被附加到这个文件来创build一个漏洞? Request GET /publicservers.php/fonts/game-servers.php/reset.css?1=null'%20UNION%20SELECT%208%2C%20table_name%2C%20'vega'%20FROM%20information_schema.tables%20WHERE%20table_name%20like'%25 Resource Content <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>403 Forbidden</title> </head><body> <h1>Forbidden</h1> <p>You don't have permission to access /publicservers.php/fonts/game-servers.php/reset.css on this server.</p> <p>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.</p> </body></html> Discussion I have detected […]

owncloud拒绝访问数据目录

我正在修复一个OwnCloud服务器。 我从一天开始就陷入困境,我开始绝望了。 Owncloud(在arch linux上设置)说: Data directory ( /data/ocdata) is invalid Please check that the data directory contains a file ".ocdata" in its root. Cannot create "data" directory ( /data/ocdata) This can usually be fixed by giving the webserver write access to the root directory. 所以我做了以下(绝望): sudo chown -R 777 /data/ocdata ocdata上的ls给出: ls /data/ocdata -a -l […]

Nginx服务器块不能正常工作

免责声明:只是澄清,我是Linux的全新,但我已经通过谷歌search和个人研究configuration一切。 我有一个Debian Wheezy服务器,我打算使用LEMP堆栈作为域的主机。 我得到了DNS的工作,所以当我进入域,我得到“欢迎nginx”页面。 麻烦的出现是因为我已经创build了将要托pipe该站点的目录,并使用该站点的文件(index.php是主页面)填充该目录,并且还configuration了服务器块(/ etc / nginx / sites- available / example.com)如下所示: UPDATED Server block server { listen 80; server_name example.com www.example.com; root /var/www/example.com; index index.php index.html index.htm; location / { try_files $uri $uri/ /index.html; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /var/www/example.com; } location ~ […]