error: PIX_FMT_RGBA32 undeclared

Posted by admin     Category: Linux Administration

The error message “Unable to load dynamic library ‘/usr/lib64/php/modules/ffmpeg.so” is received when you add the ffmpeg.so extension to the PHP configuration file i.e. php.ini file and tries to run PHP. You can easily reproduce the error message by executing “php -v”:

PHP Warning:  PHP Startup: Unable to load dynamic library ‘/usr/lib64/php/modules/ffmpeg.so’ – /usr/lib64/php/modules/ffmpeg.so: undefined symbol: _php_create_ffmpeg_frame in Unknown on line 0

You may also notice the “PIX_FMT_RGBA32″ error message while compiling ffmpeg-php

ffmpeg-php-0.5.0/ffmpeg_frame.c:495: error: ‘PIX_FMT_RGBA32′ undeclared (first use in this function)

The above error messages is the result of incorrect function declared in the ffmpeg_frame.c file under the ffmpeg-php-0.x.0 directory.

Solution:

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

vi ffmpeg-php-0.x.0/ffmpeg_frame.c

Now 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

cd ffmpeg-php-0.x.0
make clean
./configure
make
make install

Once done, ffmpeg should work along with PHP now.

Grant privileges to a Mysql user?

Posted by admin     Category: Mysql & PostGres SQL

HowTo GRANT privileges to a Mysql user?

Create a database:

mysql> create database dbname;

and grant the privileges using the following query:

mysql> grant all on dbname.* to ‘dbuser’@'localhost’ identified by ‘password’;

The user ‘dbuser’ will now have access to database ‘dbname’ locally using the password ‘password’. Using the above command, you can also allow new users to access your database as well. Just replace the ‘dbuser’ and ‘password’ with the new user and password.

To allow the user to access the database remotely say from IP 111.222.333.444, execute:

mysql> grant all on dbname.* to ‘dbuser’@’111.222.333.444‘ identified by ‘password’;

Correcting ownership of all cPanel Users

Posted by admin     Category: Scripts

If you mess up with the ownership of all the users on a cPanel server, following script will help you to correct the ownership:

#  for i in `cat /etc/trueuserdomains | awk ‘{print $2}’`
> do
> /bin/chown $i.$i /home/$i -R;

> /bin/chown $i.mail /home/$i/etc -R;
> /bin/chown $i.nobody /home/$i/public_html;
> done;

The ownership of the home directory of a user, etc and public_tml will be corrected in a one go.

Know cPanel logs in detail OR List of different log files in cPanel

Posted by admin     Category: cPanel Management

The  path to various logs files on a cPanel server for different services is listed below:

Apache Web Server Logs:

/usr/local/apache/logs/access_log
/usr/local/apache/logs/error_log

Exim (Email) Logs:

/var/log/exim_mainlog
/var/log/exim_paniclog
/var/log/exim_rejectlog

Ftp Logs:

/var/log/messages

Mysql Logs:

/var/lib/mysql/server.hostname.err

Cronjob Logs:

/var/log/cron

Server Logs:

/var/log/messages

SSH Logs:

/var/log/secure

cPanel Installation Logs:

/var/log/cpanel-install-thread0.log

ChkServd (cPanel Monitoring Daemon) Logs:

/var/log/chkservd.log

Named (Bind) Logs:

/var/log/messages

Last successful login attempts to the server:

/var/log/wtmp (but to view the details, execute the command “last”)

Last unsuccessful login attempts to the server:

/var/log/utmp (To view the logs, execute “lastb” command)

Domlogs of an Account:

/usr/local/apache/domlogs/domainname.tld

Mod Security Logs:

/usr/local/apache/logs/modsec_audit.log
/usr/local/apache/logs/modsec_debug_log

Apache SUEXEC Logs:

/usr/local/apache/logs/suexec_log

cPanel Access and Error Logs:

/usr/local/cpanel/logs/access_log
/usr/local/cpanel/logs/error_log

Stats Execution Logs:

/usr/local/cpanel/logs/stats_log

cPanel License Logs:

/usr/local/cpanel/logs/license_log

cPanel Backup Logs:

/usr/local/cpanel/logs/cpbackup/*.log

Tomcat Logs:

/usr/local/jakarta/tomcat/logs/catalina.err
/usr/local/jakarta/tomcat/logs/catalina.out

Delete Frozen Emails

Posted by admin     Category: cPanel Management, Linux Administration

Howto check number of emails in the mail queue:

exim -bpc

To check the email ID, sender and receiver of the each email:

exim -bp | more

To delete frozen emails from the mail queue, execute:

exim -bp | grep ‘frozen’ | awk ‘{print $3}’ | xargs exim -Mrm

similarly, to delete emails sent using a script’

exim -bp | grep ‘<>’ | awk ‘{print $3}’ | xargs exim -Mrm