我正在尝试运行此代码
$files = array('readme.txt', 'test.html', 'image.gif');
$zip = new ZipFile;
$zip->open('file.zip', ZipArchive::CREATE);
foreach ($files as $file) {
$zip->addFile($file);
}
$zip->close();
header('Content-Type: application/zip');
header('Content-disposition: attachment; filename=filename.zip');
header('Content-Length: ' . filesize($zipfilename));
readfile($zipname);
Run Code Online (Sandbox Code Playgroud)
并意识到我必须安装PECL拉链插件,我相信我已经完成了核心工作,因为一旦它被复制,它将它添加到我的phpinfo();
即使安装此扩展程序后,我仍然收到此消息.
致命错误:找不到类'ZipFile'
有没有人试过并成功在MAMP上安装gearman扩展?我试图在MAC OS X 10.6.8上的MAMP 2.x上进行
我想在 bluehost 共享站点上安装 PHP 扩展;特别是 MongoDB 驱动程序。由于 pecl 无法写入包含所有已安装扩展的主服务器目录,我想将 mongo.so 文件安装到我在我家下指定的目录中。我在网上找到的最接近的文章是:
http://www.site5.com/blog/programming/php/how-to-setup-your-own-php-pear-environment/20090624/
但是,按照我使用“pecl install mongo”命令时的步骤后,它仍然不断尝试安装到服务器上 bluehost 的中央目录。
我一直在尝试这个,现在仍然无法找到答案,当我尝试 sudo pecl install id3
这个错误发生
downloading id3-0.2.tgz ...
Starting to download id3-0.2.tgz (20,693 bytes)
.....done: 20,693 bytes
4 source files, building
running: phpize
Cannot find config.m4.
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module
If the command failed with 'phpize: not found' then you need to install php5-dev packageYou can do it by running 'apt-get install php5-dev' as a root userERROR: `phpize' failed
Run Code Online (Sandbox Code Playgroud)
请帮忙 !!!我已经安装了php5-dev.
我正在尝试为php安装mongo模块,我在网上找到的几乎所有安装指南都在使用pecl,当我尝试: sudo /usr/local/pear/bin/pecl install mongo
我收到这个错误:
No releases available for package "pecl.php.net/mongo"
install failed
Run Code Online (Sandbox Code Playgroud)
我是否配置了pecl错误或是否已停止?
pecl install xdebug
在 alpine 3.7 镜像构建或容器中运行(或任何其他包)总是会导致
检查 C 编译器是否工作...否
有人知道发生了什么吗?这是相关的 config.log:
configure:2695: $? = 0
configure:2684: cc -v >&5
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-alpine-linux-musl/6.4.0/lto-wrapper
Target: x86_64-alpine-linux-musl
Configured with: /home/buildozer/aports/main/gcc/src/gcc-6.4.0/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --build=x86_64-alpine-linux-musl --host=x86_64-alpine-linux-musl --target=x86_64-alpine-linux-musl --with-pkgversion='Alpine 6.4.0' --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch --disable-multilib --disable-nls --disable-werror --disable-symvers --enable-__cxa_atexit --enable-default-pie --enable-cloog-backend --enable-languages=c,c++,objc,java,fortran,ada --disable-libssp --disable-libmpx --disable-libmudflap --disable-libsanitizer --enable-shared --enable-threads --enable-tls --with-system-zlib --with-linker-hash-style=gnu
Thread model: posix
gcc version 6.4.0 (Alpine 6.4.0)
configure:2695: $? = 0
configure:2684: cc -V >&5
cc: error: unrecognized command line option …
Run Code Online (Sandbox Code Playgroud) 我从 ubuntu 18.04 创建了一个 Docker 镜像,我使用的是 php 7.1
问题是我需要在 Oauth 扩展上使用 curl 启用请求引擎支持。
这个问题的解决方案,将 cURL 添加到 OAuth 请求引擎支持的
问题并没有解决我的问题。
采取的步骤:
我很乐意应要求提供更多信息。
我的PHP版本是7.3.1,我可以看到pecl已安装在我的Mac上,但是。每当我尝试通过终端访问它时,它说pecl:command not found。请同样帮我。
我正在尝试做一个 php regexp 来屏蔽电子邮件,以便
example@gmail.com
转向e*****e@gmail.com
.
$maskedEmail=preg_replace('/^*@/', '*', $email);
Run Code Online (Sandbox Code Playgroud) 我尝试使用brew 在我的Mac 上安装amqp php 扩展。
环境: MacOS Catalina 10.15.6,Homebrew 2.5.0,PHP 7.4.10,rabbitmq 3.8.8,rabbitmq-c 0.10.0
执行后我收到以下消息:pecl install amqp
checking for pkg-config... /usr/local/bin/pkg-config
checking for amqp using pkg-config... configure: error: librabbitmq not found
ERROR: `/private/tmp/pear/temp/amqp/configure --with-php-config=/usr/local/opt/php/bin/php-config --with-librabbitmq-dir' failed
Run Code Online (Sandbox Code Playgroud)
任何想法如何解决这个问题。