首页 > 编程技术 > php

php怎么安装emmet插件?Zend Studio 中安装emmet插件的方法

发布时间:2017-7-6 23:33

小编分享的这篇文章介绍了Zend Studio中安装emmet插件的方法,不会安装的同学可以参考一下本文。

本人的Zend Studio版本是Zend Studio 10.0.0。

1. 打开Zend Studio,点击 Help --> Install New Software,如下图:

2.  在Work With中填入如下地址:http://emmet.io/eclipse/updates/ ,回车,选择某个版本的emmet,如下图,点击 Next

(由于我的Zend Studio版本不是最新的,故我也没有选择最新版本的emmet,因为无法安装成功,故我这里选择的是较旧版本的emmet)

3. 之后,就很简单了。 I agree --> Finish,就可以看到emmet插件的安装进度界面,执行安装的过程中,如果有警告弹窗,点击OK继续安装。

4. 如果提示安装成功让你重启Zend Studio,则说明安装成功了。重启Zend Studio后,emmet插件方可生效。

php怎么安装模块?本文详细介绍了安装PHP模块的方法,不会的同学可以参考一下本文,按照文中步骤即可轻松安装php模块。

首先进行相关的说明
a.安装PHP时,有些模块是php自带的(如shmop,curl,mhash,mcrypt,iconv不需要另外下载这些模块就可以直接安装,php自身包含这些模块的源码,但是有可能需要下载依赖包,比如libiconv),有些不是php自带的(如eAccelerator,APC,memcache,这些模块则需要从网上下载后然后再安装,此时一般用DSO方式安装(phpize))

比如安装php时有个配置选项./configure --with-iconv-dir=/usr/local,这句话的意思是在/usr/local目录查找lib子目录及include子目录,因为要需要用到那两个目录下面的库文件(lib目录)及头文件(include目录)
[root@CentOS_Test_Server ext]# ls /usr/local/lib/*iconv*
/usr/local/lib/libiconv.la  /usr/local/lib/libiconv.so.2      /usr/local/lib/preloadable_libiconv.so
/usr/local/lib/libiconv.so  /usr/local/lib/libiconv.so.2.5.0

虽然在php的源代码目录下有iconv的子目录,但是仍然要依赖其它的库函数及头文件,如果没有,则必须提前安装
[root@CentOS_Test_Server ext]# pwd
/home/software/php-5.2.8/ext
[root@CentOS_Test_Server ext]# ll iconv/
total 324
-rw-r--r-- 1 1002 1002   4601 Mar  1  2007 config.m4
-rw-r--r-- 1 1002 1002    749 Nov 23  2004 config.w32
-rw-r--r-- 1 1002 1002     52 Feb  5  2003 CREDITS
-rw-r--r-- 1 1002 1002  73004 Dec 31  2007 iconv.c
-rw-r--r-- 1 1002 1002   4687 Jan 17  2004 iconv.dsp
-rw-r--r-- 1 root root    305 Apr 30 20:55 iconv.lo
-rw-r--r-- 1 root root 101304 Apr 30 20:55 iconv.o
-rw-r--r-- 1 root root      1 Apr 30 20:49 php_have_bsd_iconv.h
-rw-r--r-- 1 root root     27 Apr 30 20:49 php_have_glibc_iconv.h
-rw-r--r-- 1 root root      1 Apr 30 20:49 php_have_ibm_iconv.h
-rw-r--r-- 1 root root     21 Apr 30 20:49 php_have_iconv.h
-rw-r--r-- 1 root root      1 Apr 30 20:49 php_have_libiconv.h
-rw-r--r-- 1 1002 1002     95 Aug  5  2004 php_iconv.def
-rw-r--r-- 1 1002 1002   3631 Dec 31  2007 php_iconv.h
-rw-r--r-- 1 root root     31 Apr 30 20:49 php_iconv_supports_errno.h
-rw-r--r-- 1 root root     54 Apr 30 20:49 php_php_iconv_h_path.h
-rw-r--r-- 1 root root     31 Apr 30 20:49 php_php_iconv_impl.h
drwxr-xr-x 2 1002 1002   4096 Dec  8  2008 tests

下面的php手册上的相关说明
To use shmop you will need to compile PHP with the --enable-shmop parameter in your configure line.

To use PHP's cURL support you must also compile PHP --with-curl[=DIR] where DIR is the location of the directory containing the lib and include directories. In the "include" directory there should be a folder named "curl" which should contain the easy.h and curl.h files. There should be a file named libcurl.a located in the "lib" directory. Beginning with PHP 4.3.0 you can configure PHP to use cURL for URL streams --with-curlwrappers.

php的扩展模块目录是怎么规则的呢,我想应该是跟phpize命令有些关系,phpize命令的输出中有20060613,也就是执行phpize命令的时间,然后我们看到生成的扩展模块目录中含有20060613
[root@localhost memcache-2.2.5]# /usr/local/webserver/php/bin/phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519

Installing shared extensions:     /usr/local/webserver/php/lib/php/extensions/no                                              -debug-non-zts-20060613/

手工修改:查找/usr/local/webserver/php/etc/php.ini中的extension_dir = "./"
  修改为extension_dir = "/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/"

b.安装php前,如果这些依赖包没有,则必须先安装这些依赖包,例如,你要在php中安装mhash模块,要视情况安装mhash的依赖包,再安装php,否则配置php时会报错

c.php扩展模块一般在安装完php以后,再安装php扩展模块,扩展模块一般是编译成.so文件,动态加载,不编译到php自身,如果编译到php自身,则每次需要新增加一个新的模块时就必须对整个php进行编译一次,比较耽误时间。

下面来说说几种常见的安装方法
1.用--with-xx或--enable-xx安装
就是在配置的时候加上相应的模块即可,如
./configure --enable-shmop --with-curl --enable-xml
然后make && make install即可
通过这种方式安装的模块不会生成.so文件,因此也不需要在php.ini中添加extension = "extname.so"的配置

Typically an extension that does not require external libraries uses --enable(如果configure中是使用--enable开头的模块,则这些模块一般不需要另外的函数库)

2.直接用PECL命令安装
$pecl install extname
这条命令将自动下载扩展extname的源代码,然后编译安装extname.so你的目录extension_dir中(php.ini中有设置)
This will download the source for extname, compile, and install extname.so into your extension_dir. extname.so may then be loaded via php.ini

By default, the pecl command will not install packages that are marked with the alpha or beta state. If no stable packages are available, you may install a beta package using the following command: 
$ pecl install extname-beta

You may also install a specific version using this variant: 
$ pecl install extname-0.1

Note: After enabling the extension in php.ini, restarting the web service is required for the changes to be picked up.

然后在php.ini中加入一行extension = "extname.so",重启web服务器让改变生效。

3.phpize安装(DSO方式安装)
首先下载要安装的php模块,然后解压缩,然后再执行下面几步即可
$ cd extname
$ phpize
$ ./configure
$ make
$ make install
然后在php.ini中加入一行extension = "extname.so",重启web服务器让改变生效。

4.通过php的源代码包编译(静态编译)
php手册上面写得比较全面,就直接引用手册上面的内容了
Compiling PECL extensions statically into PHP
You might find that you need to build a PECL extension statically into your PHP binary. To do this, you'll need to place the extension source under the php-src/ext/ directory and tell the PHP build system to regenerate its configure script.

$ cd /your/phpsrcdir/ext
$ pecl download extname
$ gzip -d < extname.tgz | tar -xvf -
$ mv extname-x.x.x extname

This will result in the following directory: 
/your/phpsrcdir/ext/extname

From here, force PHP to rebuild the configure script, and then build PHP as normal: 
$ cd /your/phpsrcdir 
$ rm configure
$ ./buildconf --force
$ ./configure --help
$ ./configure --with-extname --enable-someotherext --with-foobar
$ make
$ make install

Note: To run the 'buildconf' script you need autoconf 2.13 and automake 1.4+ (newer versions of autoconf may work, but are not supported).

Whether --enable-extname or --with-extname is used depends on the extension. Typically an extension that does not require external libraries uses --enable. To be sure, run the following after buildconf: 
$ ./configure --help | grep extname
这种方法安装php模块时就不需要在php.ini里面添加extension = "extname.so"了,因为模块已经编译到php里面了,是静态编译。

上面说的是在Linux下面安装php模块,在windows下面安装模块主要有如下的方法
1.直接加载

如果是php自带的模块(也就是php的扩展目录下面已经存在相应的dll文件),则在php.ini中直接将模块前面的;去掉,重启web服务器即可
例如要启用gd的功能,则将;extension=php_gd2.dll修改为extension=php_gd2.dll即可

2.在pecl网站上面下载已经编译好的dll文件,然后在php.ini中加入一行即可
例如在要windows上面安装memcache的模块,则从网上下载memcache的dll文件php_memcache.dll,然后把它复制到php的扩展目录,例如我的电脑上php扩展目录的路径为;e:/www/php5/ext
Directory in which the loadable extensions (modules) reside.
extension_dir = "e:/www/php5/ext"

3.把模块编译到php里面(也就是通过源代码编译)
简单点说,就是用vc来进行编译
说细看此页面

4.编译一个独立的dll文件
简单点说,就是用vc来进行编译,可以是别人开发好的php扩展,或者是你自己开发的也可以
说细看windows下开发并编译PHP扩展(步骤说明),这篇文章写得比较清楚,我在此恕不多言了。

引用php手册上的一段话
Installing a PHP extension
On Windows, you have two ways to load a PHP extension: either compile it into PHP, or load the DLL. Loading a pre-compiled extension is the easiest and preferred way.

To load an extension, you need to have it available as a ".dll" file on your system. All the extensions are automatically and periodically compiled by the PHP Group (see next section for the download).

To compile an extension into PHP, please refer to building from source documentation.

To compile a standalone extension (aka a DLL file), please refer to building from source documentation. If the DLL file is available neither with your PHP distribution nor in PECL, you may have to compile it before you can start using the extension.

本文详细介绍了在Windows 8 的IIS(8.0)中搭建PHP运行环境的教程,不会的同学快来看看吧。

在Windows 8 的IIS(8.0)中搭建PHP运行环境:

一:安装IIS服务器

1.进入控制面板>>程序和功能>>打开或关闭Windows 功能,找到Internet信息服务,记得选中CGI这一项

2.安装完成后在浏览器中打开localhost,查看是否能显示IIS的欢迎页面:

二:下载安装配置PHP环境

1、下载PHP,官网地址:http://windows.php.net/download/, 
2、将下载的zip压缩包解压到D盘下,解压后为E:\php; 
3、进入控制面板>>管理工具>>Internet信息服务(IIS)管理器; 
4、中间窗口选择“处理程序映射”双击,然后最右边选择“添加模块映射”

5.“可执行文件”一栏找到PHP的安装目录E:\php,右下角的文件类型改为“exe”即可看到“php-cgi.exe”文件出现了 



6.然后可以给网站添加默认文档:default.php和index.php。

还要进行下面的配置:

7.进入E:\php目录,重命名文件php.ini-development改名为php.ini并复制到桌面;

8.下面需要修改桌面的php.ini文件,

打开php.ini文件后,使用快捷键ctrl+F搜索data.timezone修改为data.timezone="Asia/Shanghai”即修改当前的时区 
激活你需要的扩展选项,即将相应dll语句前的分号”;”删除

 代码如下复制代码

extension=php_gd2.dll 
extension=php_mbstring.dll 
extension=php_mysql.dll 
extension=php_pdo_mysql.dll


再搜索extension_dir=将其修改为extension_dir = “E:\php\ext\”,修改并检查完毕后保存,然后把桌面的这个php.ini文件剪切到C:\Windows目录下即可(为什么开始不直接把文件复制到这里来修改呢,因为Windows 8涉及到权限问题,所以先复制到桌面修改,当然也可以放到其它目录修改)

9.php环境配置好了,我们就可以测试一下了,在建立的网站目录下新建一个index.php文件(注意是index.php,不是index.php.txt),内容为”“,然后再在浏览器中打开”localhost“,即可出现类似如下界面

PS1:(在命令行中进入php安装目录下,输入”php -m“命令可查看已开启的dll扩展模块)

Ps2:php网站开发的话少不了mysql数据库,关于mysql数据库环境配置安装图解见这里。

本文详细介绍了php安装目录的方法,不会的同学可以参考一下。

多数PHP开源项目里有一个install.php的文件,这个文件就是该系统的安装文件,如果要安装的话,前提是要安装PHP的运行环境。PHP集成运行环境安装很简单,只需下一步,下一步即可完成。比如非常流行的XAMPP软件等等。安装完成后,按以下步骤操作即可:

  1. 将项目复制到XAMPP安装目录下的htdocs文件夹下;

  2. 然后启动php和mysql服务;

  3. 打开浏览器,在地址栏输入:localhost/install.php,按回车即可进行安装。

标签:[!--infotagslink--]

您可能感兴趣的文章: