Showing posts with label php. Show all posts
Showing posts with label php. Show all posts

Friday, June 12, 2015

ffmpeg-php error

If you get an error as shown below during the compilation of ffmpeg-php
----------------------------------------------
configure: error: ffmpeg headers not found. Make sure ffmpeg is compiled as shared libraries using the --enable-shared option
----------------------------------------------

Install the below packages:
---------------------------
yum install ffmpeg-devel
---------------------------

Saturday, February 28, 2015

ImageMagick Installation Error : ImageMagick MagickWand API configuration program... configure: error: not found.

If you get the below error while installing PHP extension imagick. I used the command "pecl install imagick" and got the below error:


To fix this error install the ImageMagick-devel package.

yum install ImageMagick-devel

In Ubuntu, you can resolve this by installing a few extra packages.

sudo apt-get install libmagickwand-dev libmagickcore-dev

Sunday, October 26, 2014

Disabling Core Dumps in cPanel

I recently found a (cPanel) server was generating over 100Gb of core dumps every time a bad PHP script died or Apache died. Writing these generally useless (who actually debugs these on a live web server) to disk is a pointless waste of disk I/O, especially in a VPS environment.

Here is two methods of disabling core dumps;cPanel/WHM

  1. Login to WHM
  2. Select ‘Tweak Settings’
  3. Search for ‘core’
  4. Turn ‘Generate core dumps’ off.
Linux

I usually do this on cPanel servers also, just to be double sure!

1. Disable core dumps for all users.
Edit /etc/security/limits.conf and check that * hard core 0 exists

2. Disable core dumps for setuid programs


echo 'fs.suid_dumpable = 0' >> /etc/sysctl.conf
sysctl -p

3. Finally, set a soft limit to stop core dumps being created

echo 'ulimit -S -c 0 > /dev/null 2>&1' >> /etc/profile
No reboot required.

Wednesday, May 23, 2012

install ioncube for PHP 5.2.10



This are the steps to install ioncube loader for php in linux.
# cd /usr/local/src/
# wget http://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz
# tar -xvf ioncube_loaders_lin_x86.tar.gz
# cd ioncube/
# ls
ioncube_loader_lin_4.1.so
ioncube_loader_lin_4.2.so
ioncube_loader_lin_4.3.so
ioncube_loader_lin_4.3_ts.so
ioncube_loader_lin_4.4.so
ioncube_loader_lin_4.4_ts.so
ioncube_loader_lin_5.0_ts.so
ioncube_loader_lin_5.1.so
ioncube_loader_lin_5.1_ts.so
ioncube_loader_lin_5.2_ts.so
ioncube_loader_lin_5.3.so
ioncube_loader_lin_5.3_ts.so
ioncube_loader_lin_5.4.so
ioncube_loader_lin_5.4_ts.so

copy the version of module which you want to the location below

# mkdir /usr/local/lib/ioncube
# cp ioncube_loader_lin_5.2.so /usr/local/lib/ioncube

open php.ini in your favorite text editor:
add this line
zend_extension=/usr/local/lib/ioncube/ioncube_loader_lin_5.2.so

# php -v
PHP 5.2.10 (cli) (built: Nov 13 2009 11:24:03)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
    with the ionCube PHP Loader v4.2.0, Copyright (c) 2002-2012, by ionCube Ltd., and
    with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies

You will note that PHP is loaded with the ionCube PHP Loader v4.2.0.

Failed to load Inline module


Today while going through the error log of a server. The logs were flooding with this error. Actually its not an error its just a warning.
# tail -f /var/log/httpd/error_log
[Tue May 22 21:00:16 2012] [error] [client 78.50.114.80] Failed to load Inline module for best performance. at ./split_dyn.pl line 11., referer: http://domain.com/sblogin/login.shtml/members/

On searching found that  Inline module is a perl module. We can install the Inline module by logging into the server as root and giving the following command.
# perl -MCPAN -e 'install Inline'
The installation will stop a few times for us to manually enter y / yes for a few questions. We can confim that the module is installed when we finally see this line.

Writing /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/Inline/.packlist
Appending installation info to /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/perllocal.pod
/usr/bin/make install  -- OK

Friday, April 13, 2012

Installing LAMP on Linux --> The easy way

What is LAMP? Its actually a short form the expansion of LAMP is
L --> Linux
A --> Apache
M --> Mysql
P --> Php {{ P can be perl or python too }}
These are the basic things which are needed for a web server to work. The steps for installation are for red hat flavoured Linux systems or servers.
Login as root to the server where LAMP is to be installed.

  • APACHE
# yum install httpd httpd-devel
# /etc/init.d/httpd start
Now the apache will be installed and its running. You can verify the installation by giving the command.
# telnet localhost 80 which should give the output silimilar to this
--------------------------------------------------------------
telnet localhost 80
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
--------------------------------------------------------------
To configure apache you will have to edit the configuration file /etc/httpd/conf/httpd.conf. Please make sure to restart apache after editing configuration file for changes to take effect.
#/etc/init.d/httpd restart
  • MYSQL
# yum install mysql mysql-server mysql-devel
# /etc/init.d/mysqld start
Now Mysql is started. We will perform a quick basic setup of mysql now.
Note: For fedora 16/17 users
systemctl start mysqld.service
systemctl enable mysqld.service
# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 349034 to server version: 4.1.22-standard
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
Set the mysql root password now:
mysql>USE mysql;
(Replace 'yourpass with your required password' in the command below)
mysql> UPDATE user SET Password=PASSWORD('yourpass') WHERE user='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
Bye
Now to login with new details:
mysql -u root -p
Enter Password:

  • PHP
# yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
# /etc/init.d/httpd restart
To verify the php installation type the command below:
# php -v
We can also create a php info page to test this.

Friday, December 2, 2011

Install LAMP and phpMyAdmin on Ubuntu 11.10 Easy Way

Open terminal and type the command given below. Please note that we have to give "^" at the end and its not a typo. Many prompts will pop up during installation to set password or asking for the server password. Please give them when asked for.
sudo apt-get install lamp-server^

After Installation open a web browser and enter the address http://localhost/.

You should see a page that says "It Works!" Hence you can confirm that apache is working perfectly.

Create a file in the /var/www directory called info.php. Enter the following command in the terminal to create the file.
echo "" | sudo tee /var/www/info.php

Now open a web browser again and enter the address http://localhost/info.php . You will get a php info page. If you are not getting this page try restarting apache2 by giving the command below.
/etc/init.d/apache2 restart

INSTALLING PHPMYADMIN.

LAMP installation will not install phpmyadmin. Also phpmyadmin is not required for the proper functioning of LAMP. It just gives an easy platform for editing.
sudo apt-get install libapache2-mod-auth-mysql phpmyadmin

Open your web browser and enter the address http://localhost/phpmyadmin/ to access it.



Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews