CENTOS Apache 2 + PHP 5.3 + Mysql5 installation (additional: for gallery3 prepare)

l  I nstall apache, php, mysql

>yum -y install httpd php mysql mysql-server php-mysql

 

l  U pgrade to php5.3 (a bove command just install s php5.1 )

>rpm -ivh http://repo.webtatic.com/yum/centos/5/`uname -i`/webtatic-release-5-1.noarch.rpm

该命令会在 /etc/yum.repos.d/ folder 下生成一个 ”webtatic.repo” file ,作为其中一个 yum repo ( 你可以通过命令 >yum repolist all 来查看你的 yum repo list )

 

>yum --disablerepo=* --enablerepo=webtatic update php

该命令是 disable 所有 repo ,然后只 enable webtatic repo and then use yum to update php to version 5.3

 

l  install gd (version 2)

>yum --disablerepo=* --enablerepo=webtatic install php-gd

 

 

Additional Steps for gallery3

 

l  install php mbstring module

>yum --disablerepo=* --enablerepo=webtatic install php-mbstring

 

l  install ffmpeg

1. C reate a repo file for DAG RPM repository

>vi /etc/yum.repos.d/dag.repo

 

2. A dd following codes to dag.repo file

[dag]

name=DAG RPM Repository

baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag

gpgcheck=1

enabled=1

 

3. check if ffmpeg exists

>yum search ffmpeg

 

4. install ffmpeg

>yum install ffmpeg

if following error occurs:

Public key for ffmpeg-libpostproc-0.6.1-1.el5.rf.i386.rpm is not installed

then run

>rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt

run following again

>yum install ffmpeg ffmpeg-devel ffmpeg-libpostproc

 

 

l  install ffmpeg-php

1. Download the latestet ffmpeg-php from http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/

>wget http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2/download

 

2. Extract the archive

> tar -xjf ffmpeg-php-X.x.x.tbz2

 

3. > cd ffmpeg-php-X.x.x/

 

4. >phpize

5. >./configure

6. >make

 

这时会出错:

....error 'PIX_FMT_RGBA32' undeclared...

解决方法:

Goto the the ffmpeg-php-0.x.0 directory and edit the ffmpeg_frame.c file

>vi ffmpeg_frame.c

replace every instance of PIX_FMT_RGBA32 with PIX_FMT_RGB32 in the file by executing

    :%s/PIX_FMT_RGBA32/PIX_FMT_RGB32

OR

    replace “PIX_FMT_RGBA32 “PIX_FMT_RGB32 — ffmpeg_frame.c

Save the file and compile ‘ffmpeg-php’ again using the following steps

>make clean

>./configure

>make

7. >make install

Above installation will copy the ffmpeg.so module in php default module location.

 

8. edit php.ini file to enable ffmpeg-php support in it by using ffmpeg.so module.

>vi /etc/php.ini

and append following line

        extension=ffmpeg.so

9. Restart apache service to take effect of php.ini

>/etc/init.d/httpd restart

10. Run following command to ffmpeg module listing in php.

> php -m | grep ffmpeg

You should be able to see ffmpeg module in phpinfo() page.

 

Test it out using

ffmpeg -i videofilename.extension

 

For more about ffmpeg-php functions –  documentation

http://ffmpeg-php.sourceforge.net/doc/api/ffmpeg_movie.php

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值