在Windows上使用XAMPP安装PHP YAML Extension [英] Installing PHP YAML Extension with XAMPP on Windows
问题描述
大家好,我目前在PhP上做一些工作,要求我使用 yaml_parse_file()
函数来解析YAML文件.我还是该语言的新手,所以当我尝试在Windows上未经修改的XAMPP服务器上使用该功能时,出现错误找不到功能".经过一些研究,我发现您实际上应该在php安装上安装扩展程序,以便能够使用该功能. http://php.net/manual/zh/yaml.setup.php 该链接详细介绍了安装过程,尽管我已阅读了该链接,但是对于安装过程却感到困惑.上面的链接指出没有DLL包可供下载,但是对此链接有直接注释 http://pecl.php.net/package/yaml ,您可以在其中清楚地看到YAML解析器的DLL程序包.我的问题是,是否可以引导我逐步了解如何使用XAMPP在Windows机器上执行此安装过程.
Hey folks I am currently doing some work on PhP that requires me to parse a YAML file by using the yaml_parse_file()
function. I am still new to the language and all so when I tried using that function on my unmodified XAMPP server on Windows I got the error 'function not found'. After some research I found out that you are actually supposed to install extensions on your php installation to be able to use that function. http://php.net/manual/en/yaml.setup.php this link details the installation process and I have read through it however I am confused in regards to the installation procedure. The above link states that there is not a DLL package available for download however a comment direct to this link http://pecl.php.net/package/yaml where you can clearly see a DLL Package for YAML Parser. My question is if you could please walk me through how to go about this installation procedure on a Windows Machine using XAMPP.
https://code.google.com/p/php-yaml/wiki/InstallingWithPecl 此链接可能会为您提供有关此主题的更多见解,尽管我无法理解其全部工作原理:(
https://code.google.com/p/php-yaml/wiki/InstallingWithPecl this link might offer you more insight on this topic although I fail to understand how it all works :(
Edit2:我尝试下载上面链接中给出的DLL,并将其添加到我的php/ext文件夹中,并在php.ini中添加一个条目 extension = php_yaml.dll
,但是当我尝试时要测试我的扩展程序是否已通过以下脚本加载,我会收到错误消息.
I have tried to download the DLL given on the above link and add it to my php/ext folder and add an entry in php.ini extension=php_yaml.dll
but when I try to test if my extension has been loaded by the following script, I get an error.
<?php
if (extension_loaded(yaml))
echo "yaml loaded :)";
else
echo "something is wrong :(";
?>
推荐答案
在读者的帮助下,我似乎已经缩小了完成此步骤的步骤.
With a bit of help from the readers I seem to have narrowed down the steps to accomplish this.
- 下载最新的YAML DLL程序包
- 解压缩文件
- 将
php_yaml.dll
文件移动到xampp/php/ext
文件夹 - 在
xampp/php
中打开您的php.ini
,并添加extension = php_yaml.dll
行,保存并退出 - 现在将zip文件夹中的
yaml.dll
文件移至xampp/apache/bin
文件夹 - 关闭并重新启动XAMPP服务器
- 加载php脚本
echo phpinfo();
- 在页面上搜索字符串
yaml
.如果显示已启用",则说明您的YAML扩展正在运行.
- Download the latest YAML DLL Package
- Unzip the files
- Move the
php_yaml.dll
file toxampp/php/ext
folder - Open your
php.ini
inxampp/php
and add the lineextension=php_yaml.dll
, save and exit - Now move the
yaml.dll
file from the zip folder contents and move it to thexampp/apache/bin
folder - Close and restart your XAMPP Servers
- Load a php script
echo phpinfo();
- Search the string
yaml
on the page. If it says Enabled then your YAML Extension is working.
这篇关于在Windows上使用XAMPP安装PHP YAML Extension的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!