PDA

View Full Version : Can't install php-devel ):



SimonTheMime
02-18-2010, 08:41 AM
Ola sisters and brothers,

I'm adding a video module to my site, and have thus far installed the necessary programs for it (ffmpeg being one of them). I've come across a problem in installing ffmpeg-php however because I require the tool phpize to install it.

Phpize command is provided by php-devel. However, when trying to install php-devel, I am faced with:


# yum -y install php-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: mirrors.netdna.com
* base: mirror.steadfast.net
* extras: holmes.umflint.edu
* rpmforge: fr2.rpmfind.net
* updates: mirrors.xmission.com
addons | 951 B 00:00
base | 2.1 kB 00:00
c5-testing | 951 B 00:00
extras | 1.1 kB 00:00
rpmforge | 1.1 kB 00:00
updates | 1.9 kB 00:00
Excluding Packages in global exclude list
Finished
Reducing CentOS-5 Testing to included packages only
Finished
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-devel.i386 0:5.2.10-1.el5.centos set to be updated
--> Processing Dependency: php = 5.2.10-1.el5.centos for package: php-devel
--> Processing Dependency: automake for package: php-devel
--> Running transaction check
---> Package automake.noarch 0:1.9.6-2.1 set to be updated
---> Package php-devel.i386 0:5.2.10-1.el5.centos set to be updated
--> Processing Dependency: php = 5.2.10-1.el5.centos for package: php-devel
--> Finished Dependency Resolution
php-devel-5.2.10-1.el5.centos.i386 from c5-testing has depsolving problems
--> Missing Dependency: php = 5.2.10-1.el5.centos is needed by package php-devel-5.2.10
-1.el5.centos.i386 (c5-testing)
Error: Missing Dependency: php = 5.2.10-1.el5.centos is needed by package php-devel-5.2.1
0-1.el5.centos.i386 (c5-testing)
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
package-cleanup --dupes
rpm -Va --nofiles --nodigest


I edited out php* from /etc/yum.conf while attempting to install php-devel

I know that DA needs to control anything php-related, and so I'm really trying to proceed with caution here. Can anybody give me some tips? I've put up my phpinfo: http://www.ballotorthebullet.com/phpinfo.php

scsi
02-18-2010, 08:46 AM
Thats not how you install it. You have to install it via source and compile it into php. Check the custombuild section or search the forum.

SimonTheMime
02-18-2010, 08:53 AM
Thats not how you install it. You have to install it via source and compile it into php. Check the custombuild section or search the forum.
Ugh why didn't I think of that.

Thank you scsi.

floyd
02-18-2010, 08:53 AM
Follow my instructions for installing ffmpeg on CentOS. I think it is posted here somewhere.

SimonTheMime
02-18-2010, 09:20 AM
Follow my instructions for installing ffmpeg on CentOS. I think it is posted here somewhere.
This?


# Install FFMPEG on CentOS
cd /root
echo "[dag]" > /etc/yum.repos.d/dag.repo
echo "name=Dag RPM Repository for Red Hat Enterprise Linux" >> /etc/yum.repos.d/dag.repo
echo "baseurl=http://apt.sw.be/redhat/el\$releasever/en/\$basearch/dag" >> /etc/yum.repos.d/dag.repo
echo "gpgcheck=0" >> /etc/yum.repos.d/dag.repo
echo "enabled=1" >> /etc/yum.repos.d/dag.repo

yum -y install ffmpeg ffmpeg-devel flvtool2 mencoder
wget http://internap.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.3.1.tbz2
tar -xjf ffmpeg-php-0.5.3.1.tbz2
cd ffmpeg-php-0.5.3.1/
phpize
./configure
make
make install
# Note in my php.ini file I have extension_dir = "/usr/local/lib/php/extensions"
# so therefore I copy the ffmpeg.so to that. You need to check your own extension_dir
cp /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so /usr/local/lib/php/extensions/
echo "extension=ffmpeg.so" >> /etc/php.ini
service httpd restart

Also, where can I find php-devel source? I can't seem to find it on google anywhere or php.net

floyd
02-18-2010, 09:24 AM
That's it.

How do you know you don't have phpize? Did you run:


whereis phpize

SimonTheMime
02-18-2010, 09:37 AM
That's it.

How do you know you don't have phpize? Did you run:


whereis phpize
Ahhh there it is, thank you! Now upon ./configure && make, all goes well until:


# ./configure && make
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ANSI C... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
configure: error: Cannot find php-config. Please use --with-php-config=PATH

I searched online for a solution, and it looks like I need php-devel for this?

floyd
02-18-2010, 09:40 AM
whereis php-config

Same place as phpize.

floyd
02-18-2010, 09:46 AM
Evidently you do not have /usr/local/bin/ in your path.


echo $PATH

SimonTheMime
02-18-2010, 09:49 AM
whereis php-config

Same place as phpize.
Ah beautiful, so I was able to run it with:

./configure --with-php-config=/usr/local/bin/php-config && make

However, for the make it hits me with the error:


...
/root/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function 'zim_ffmpeg_frame_toGDImage':
/root/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: 'PIX_FMT_RGBA32' undeclared (first use
in this function)
/root/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: (Each undeclared identifier is reported
only once
/root/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: for each function it appears in.)
/root/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function 'zim_ffmpeg_frame_ffmpeg_frame':
/root/ffmpeg-php-0.6.0/ffmpeg_frame.c:421: error: 'PIX_FMT_RGBA32' undeclared (first use
in this function)
make: *** [ffmpeg_frame.lo] Error 1

floyd
02-18-2010, 09:56 AM
Google search gave me this http://panchathan.wordpress.com/2009/05/03/make-ffmpeg_framelo-error-1/

SimonTheMime
02-18-2010, 10:12 AM
Ah easy enough, that went through perfectly. Thanks!

nobaloney
02-18-2010, 11:26 AM
Okay, it's time for me to recreate my wiki, from scratch. If I do, we'll have a place to start putting instructions such as these. Please see this thread (http://www.directadmin.com/forum/showthread.php?t=21755).

Jeff

SimonTheMime
02-18-2010, 11:28 AM
!

I'm hoping you can still help. I executed:

cp /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so /usr/local/lib/php/extensions/
echo "extension=ffmpeg.so" >> /usr/local/lib/php.ini
service httpd restart

Upon restart, my websites went down. I wasn't sure, so I rebooted the server, still not up, and service httpd restart now gives me:


# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: [Thu Feb 18 12:20:11 2010] [warn] module php5_module is already loaded, s
kipping
[Thu Feb 18 12:20:11 2010] [warn] NameVirtualHost 66.79.186.85:443 has no VirtualHosts

Please help, don't know what just happened. DirectAdmin still functions on the domains/ip:2222.

In worst case scenario, I have a backup I can go back to.

scsi
02-18-2010, 11:29 AM
Well whys it not starting? Check the apache error log.

floyd
02-18-2010, 11:36 AM
Right after a restart:

tail -100 /var/log/httpd/error_log

nobaloney
02-18-2010, 11:38 AM
I use:

# service httpd restart ; tail -f /var/log/httpd/error_log
This restarts apache then shows me all the lines in the error log beginning immediately after the restart, until I use Control-C to exit.

Jeff

SimonTheMime
02-18-2010, 11:38 AM
Well whys it not starting? Check the apache error log.


[Thu Feb 18 12:25:13 2010] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Feb 18 12:25:13 2010] [warn] module php5_module is already loaded, skipping
[Thu Feb 18 12:25:14 2010] [warn] RSA server certificate CommonName (CN) `localhost' does
NOT match server name!?
/usr/sbin/httpd: symbol lookup error: /usr/local/lib/php/extensions/ffmpeg.so: undefined
symbol: register_ffmpeg_frame_class
[Thu Feb 18 12:26:02 2010] [warn] RSA server certificate CommonName (CN) `localhost' does
NOT match server name!?
[Thu Feb 18 12:26:02 2010] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Feb 18 12:26:02 2010] [warn] module php5_module is already loaded, skipping
[Thu Feb 18 12:26:03 2010] [warn] RSA server certificate CommonName (CN) `localhost' does
NOT match server name!?
/usr/sbin/httpd: symbol lookup error: /usr/local/lib/php/extensions/ffmpeg.so: undefined
symbol: register_ffmpeg_frame_class
[Thu Feb 18 12:26:13 2010] [warn] RSA server certificate CommonName (CN) `localhost' does
NOT match server name!?
[Thu Feb 18 12:26:13 2010] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Feb 18 12:26:13 2010] [warn] module php5_module is already loaded, skipping
[Thu Feb 18 12:26:14 2010] [warn] RSA server certificate CommonName (CN) `localhost' does
NOT match server name!?
/usr/sbin/httpd: symbol lookup error: /usr/local/lib/php/extensions/ffmpeg.so: undefined
symbol: register_ffmpeg_frame_class

This is what it tells me.

Edit: Ah thanks for the tail. This whole time I've been using vim to view this kind of stuff.

nobaloney
02-18-2010, 11:45 AM
There are other neat things you can do... for example, to see only errors, you can do:

service httpd restart ; tail -f /var/log/httpd/error_log | grep error

There's currently an interesting magazine on the local newsstands:Linux Shell Handbook. In the US it's a Linux Pro Magazine Special; in the rest of the world it's a Linux Magazine Special.

Jeff

floyd
02-18-2010, 11:49 AM
Comment out the ffmpeg stuff at the end of php.ini and restart. Something is wrong with your ffmpeg.so

SimonTheMime
02-18-2010, 11:57 AM
Comment out the ffmpeg stuff at the end of php.ini and restart. Something is wrong with your ffmpeg.so
Commenting it brought it back, yep. For the record, tailing with grep error (with it uncommented) returns:


Stopping httpd: [ OK ]
Starting httpd: [Thu Feb 18 12:49:14 2010] [warn] module php5_module is already loaded, s
kipping
[Thu Feb 18 12:49:14 2010] [warn] NameVirtualHost 66.79.186.85:443 has no VirtualHosts

[Thu Feb 18 12:49:13 2010] [error] [client 202.160.178.87] File does not exist: /var/www/
html/299
[Thu Feb 18 12:49:13 2010] [error] [client 202.160.178.87] File does not exist: /var/www/
html/404.shtml
/usr/sbin/httpd: symbol lookup error: /usr/local/lib/php/extensions/ffmpeg.so: undefined
symbol: register_ffmpeg_frame_class

Commented, sites are running. What could be wrong with the ffmpeg.so?

SimonTheMime
02-18-2010, 12:29 PM
Could it have anything to do with this? Forgive me for my ignorance, but I don't think this looks right?


[root@hostname /]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin::/root
/bin

floyd
02-18-2010, 01:16 PM
I do not know what could be wrong. The path is fine though.

Try installing the newest version.

SimonTheMime
02-18-2010, 01:28 PM
I do not know what could be wrong. The path is fine though.

Try installing the newest version.
Yeah I had realized that my installations were not of your suggested repository (as part of a previous installation, same version though).

I reinstalled them with the dag repository, did the entire steps again (including reinstalling ffmpeg-php) and still get the same error:

/usr/sbin/httpd: symbol lookup error: /usr/local/lib/php/extensions/ffmpeg.so: undefined
symbol: register_ffmpeg_frame_class

I'm using a newer version of ffmpeg-php than the one in your tutorial, could that be why?

floyd
02-18-2010, 01:37 PM
But did you download and try to install ffmpeg-php-0.6.0.tbz2 instead of ffmpeg-php-0.5.3.1.tbz2

SimonTheMime
02-18-2010, 02:15 PM
Yep I've been using that new package since the beginning.

floyd
02-18-2010, 02:23 PM
Well maybe that is the problem. My instructions use the older package.

SimonTheMime
02-18-2010, 02:38 PM
Floyd thank you for helping me.

It now returns no errors, however I do not see where it is on phpinfo to confirm it is installed properly. Any idea?

A ctrl+f for ffmpeg returns nothing.

floyd
02-18-2010, 02:42 PM
Did you uncomment the ffmpeg in php.in and restart apache?

SimonTheMime
02-18-2010, 02:45 PM
Did you uncomment the ffmpeg in php.in and restart apache?
Yep, uncommented and restarted httpd, no errors. It's not showing in phpinfo though.

floyd
02-18-2010, 02:53 PM
I would start over again from the beginning of install ffmepg.

I just looked at my own notes again and I have started using the newest version. I have installed it on several servers.

You did not install any php rpm's did you?

Think about all the stuff you tried to do prior to posting here. Try to undo it.

floyd
02-18-2010, 02:54 PM
My current notes:


# Install FFMPEG CentOS
cd /root
echo "[dag]" > /etc/yum.repos.d/dag.repo
echo "name=Dag RPM Repository for Red Hat Enterprise Linux" >> /etc/yum.repos.d/dag.repo
echo "baseurl=http://apt.sw.be/redhat/el\$releasever/en/\$basearch/dag" >> /etc/yum.repos.d/dag.repo
echo "gpgcheck=0" >> /etc/yum.repos.d/dag.repo
echo "enabled=1" >> /etc/yum.repos.d/dag.repo

yum -y install ffmpeg ffmpeg-devel flvtool2 mencoder
wget http://internap.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.6.0.tbz2
tar -xjf ffmpeg-php-0.6.0.tbz2
cd ffmpeg-php-0.6.0/
/usr/local/bin/phpize
./configure --with-php-config=/usr/local/bin/php-config
make
make install
cp /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so /usr/local/lib/php/extensions/
echo "extension=ffmpeg.so" >> /etc/php.ini
service httpd restart

SimonTheMime
02-18-2010, 03:04 PM
PHP rpms, no.

I did your steps; I'm getting the error again. The old version of ffmpeg-php returned no errors, so perhaps I should be sticking with that one?

floyd
02-18-2010, 03:06 PM
The new one works with my stuff. I am using CentOS 5.4 32 bit.

SimonTheMime
02-18-2010, 03:16 PM
The new one works with my stuff. I am using CentOS 5.4 32 bit.
It's just this error I keep getting:


/usr/sbin/httpd: symbol lookup error: /usr/local/lib/php/extensions/ffmpeg.so: undefined
symbol: register_ffmpeg_frame_class

floyd
02-18-2010, 03:41 PM
whereis ffmpeg

SimonTheMime
02-18-2010, 04:48 PM
whereis ffmpeg

[root@ballotorthebullet ~]# whereis ffmpeg
ffmpeg: /usr/bin/ffmpeg /usr/local/bin/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz

floyd
02-18-2010, 05:07 PM
You have 2 ffmpeg. Delete /usr/local/bin/ffmpeg

SimonTheMime
02-18-2010, 06:03 PM
You have 2 ffmpeg. Delete /usr/local/bin/ffmpeg
Okay I rm -r'd that dir, reinstalled ffmpeg-php, still same error on apache restart.

): This is so sad. Is there any hope?

SimonTheMime
02-18-2010, 07:19 PM
Perhaps I have more than one php installed?



[root@ballotorthebullet /]# which php
/usr/bin/which: no php in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/bin:/sbi
n:/usr/bin:/usr/sbin::/root/bin)

[root@ballotorthebullet /]# whereis php
php: /usr/local/bin/php /usr/local/lib/php /usr/local/lib/php.ini

php - or php -r isn't even working


-bash: php: command not found

floyd
02-19-2010, 05:57 AM
As I stated before /usr/local/bin is not in your path so the simple php command is not going to work. You would have to use /usr/local/bin/php

We could spend a few days going back and forth trying to fix this or you can hire somebody to just do it for you if you are in a hurry.

SimonTheMime
02-19-2010, 06:59 AM
As I stated before /usr/local/bin is not in your path so the simple php command is not going to work. You would have to use /usr/local/bin/php

We could spend a few days going back and forth trying to fix this or you can hire somebody to just do it for you if you are in a hurry.
Floyd, first I'd like to say thank you so much for assisting me thus far.

I'm not in a rush, I'm definitely trying to learn more about this; I've administered servers before but never for web.

I've made some progress, changed the path, added in the bashrc PATH=$PATH:/usr/local/bin, now the path is fixed, php -v and other commands display as they should.

floyd
02-19-2010, 09:49 AM
I think you probably have something installed before posting here that is interfering. There is a conflict somewhere.

SimonTheMime
02-19-2010, 10:04 AM
I think you probably have something installed before posting here that is interfering. There is a conflict somewhere.
Most likely.

Oh well, I've given up. I've now completely reinstalled centos, directadmin, importing my site back in and hopefully I won't be getting this error anymore.

Thanks a lot for your help floyd ^__^'

EDIT: IT WORKSS! ^__^^'