我正在尝试使用php fopen函数将文件写入我的/ tmp目录(在apache服务器上),但它失败了:
<?php
$handle = fopen("/tmp/test.txt", "x");
if ($handle)
echo "Success!";
else
print_r(error_get_last());
Run Code Online (Sandbox Code Playgroud)
这将返回错误消息"无法打开流:没有此类文件或目录"./ tmp目录的权限设置为drwxrwxrwt,我可以看到Web用户正在向其写入其他文件.神奇的是,如果我将脚本指向具有权限777的另一个文件夹,它将返回成功.但我的open_basedir"没有价值".我有safe_mode = on和allow_url_fopen = off,但我认为不应该解释它吗?
这是关于apache 2.0的php 5.3.10.
我有一个使用html5 <audio>标签在浏览器中播放音频的JavaScript .它在iPhone浏览器中运行良好,但在Android中无效.(使用Android 2.1的htc欲望测试.)任何人都知道为什么?
我的代码:
function playHTML5(sound, soundcv){
// sound = url to m4a audio file
// soundcv = div in which the audioplayer should go
var audio = document.createElement('audio');
audio.src = sound;
audio.controls = "controls";
if (currentSound != null){
soundcv.replaceChild(audio,currentSound);
} else {
soundcv.appendChild(audio);
}
currentSound = audio;
}
Run Code Online (Sandbox Code Playgroud)
顺便说一句,我也试图放大显示在iphone中的音频按钮(默认的一个很小),到目前为止没有运气 - 会对任何想法感激不尽!
在Android浏览器中使用html5'audio'标签可以播放哪些音频格式?有谁知道在哪里可以找到Android浏览器支持的官方规格而不是?
为了记录,Android媒体格式页面似乎没有涵盖这一点 - 我有一个声音文件(3gp)在本机应用程序中正常播放,但它们不会在我的webapp中播放.
webkit文档似乎也没有帮助.我的声音文件在iphone上的webapp中运行良好,因此webkit版本可以很好地处理它们.Android浏览器不应该在某个地方有一些官方文档吗?