该网站在撰写本文时处于:http://ajf.me/stuff/eva.源代码是这样的:
<!DOCTYPE html>
<html style="height: 100%;">
<head>
<title>eva</title>
</head>
<body style="background-color: black; background-image: url('eva.png'); background-repeat: no-repeat; background-position: center center; height: 100%; margin: 0px; padding: 0px;">
<audio autoplay loop>
<source src="eva.mp3" type="audio/mpeg" />
<source src="eva.ogg" type="audio/ogg" />
<source src="eva.wav" type="audio/wav" />
</audio>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
Chrome,IE9和Firefox中的音频播放效果很好,但不会在后者中循环播放.音频文件不会格式错误,因为它是由Audacity生成的.为什么它不循环还有其他解释吗?
我有一个CGI脚本(编译的C程序),它输出其命令行参数(argv [0],argv [1]等).
如果我尝试http://ajf.me/c/?abc,我会将"abc"作为第二个参数.
但是,如果我尝试http://ajf.me/c/?a=bc我没有得到任何第二个参数.
为什么使用=停止参数传递给程序?
如果重要的是C代码:
#include <stdio.h>
int main (int argc, char *argv[]) {
int i;
printf("Content-Type: text/html;charset=utf-8\n\n");
printf("<!DOCTYPE html>\n");
printf("<html>\n");
printf("<head>\n");
printf("<title>ajf.me powered by ANSI C!</title>\n");
printf("</head>\n");
printf("<body>\n");
printf("<h2>Supplied Arguments</h2>\n");
printf("argc: %d\n", argc);
printf("<ol>\n");
for (i = 0; i < argc; ++i) {
printf("<li>%s</li>\n", argv[i]);
}
printf("</ol>\n");
printf("<em>Yes, this is vulnerable to null-byte injection. For instance, <a href=\"?Injected%%00Null\" style=\"font-family: monospace; color: green;\">?Injected\\0Null</a>.</em>\n");
printf("</body>\n");
printf("</html>\n");
}
Run Code Online (Sandbox Code Playgroud) 我正在开发一个php扩展,将其升级到PHP7,我的问题是关于INTERNAL_FUNCTION_PARAMETERS.在之前的版本中,它被定义为:
INTERNAL_FUNCTION_PARAMETERS int ht, zval *return_value, zval **return_value_ptr, zval *this_ptr, int return_value_used TSRMLS_DC
在新的zend引擎中,它被定义为:
INTERNAL_FUNCTION_PARAMETERS zend_execute_data *execute_data, zval *return_value
我有php函数,它返回一个数组,它看起来像这样:`
PHP_FUNCTION( myFunc ){ zval* myArray;
array_init(myArray);
/////
zval_ptr_dtor( &return_value );
*return_value_ptr = myArray;
}
Run Code Online (Sandbox Code Playgroud)
如果没有hanvig我应该如何获得类似的功能return_value_ptr?我应该使用#define RETURN_ARR(r)?,如果是这样,这对性能有何影响?
当我升级到PHP7时,我从mongo移动到mongodb扩展.我唯一无法弄清楚的是通过id更新doc.Mongo曾经使用MongoId类来解析字符串中的id,但我找不到Mongodb的任何等价物.
这就是我所处的位置,哪些不起作用
$collection->updateOne(['_id' => '567eba6ea0b67b21dc004687'], ['$set' => ['some_property' => 'some_value']]);
Run Code Online (Sandbox Code Playgroud) 我正在CentOS 7上编译PHP7.我已经添加了EPEL存储库并安装uw-imap-devel了"libc-client.so" \usr\lib64.当我使用imap支持运行configure命令时:
./configure --with-apxs2=/usr/bin/apxs --with-mysqli --with-imap --with-imap-ssl --with-kerberos --with-pdo-mysql --with-openssl --with-curl --enable-pcntl --libdir=/usr/lib64 --with-zlib --enable-zip --enable-mbstring --enable-intl --with-readline --with-xsl --with-gd --with-jpeg-dir=/usr/lib64 --with-png-dir=/usr/lib64 --with-gmp --enable-bcmath --enable-opcache --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d
我明白了:
" ...
configure:error:找不到imap库(libc-client.a).请检查您的c-client安装.
"
我目前在使用PHP7.0-FPM时遇到一些问题使一些麻烦的opcache条目无效.
当我在opcache_get_status中查看时,某些文件正在缓存,内存大小为680.00b.这些文件的大小通常约为50kb,并且似乎正确缓存,但Opcache报告的这些文件数量正好是680.00b.
Opcache设置:
; configuration for php opcache module
; priority=10
zend_extension=opcache.so
opcache.memory_consumption=16384
opcache.max_accelerated_files=32531
opcache.validate_timestamps=0
opcache.revalidate_freq=600
opcache.max_file_size=0
opcache.fast_shutdown=1
Run Code Online (Sandbox Code Playgroud)
这是一个不寻常的设置,其中生成的文件被缓存,因此偶尔存在问题并且文件被替换/重新访问.
是否有任何理由可以想到为什么opcache将这些文件显示为680.00b?opcache_reset或opcache_invalidate没有帮助.我必须完全替换文件并使用opcache_reset来显示它们的真实文件大小,这使得监视/故障排除变得困难.
提前致谢.