Posts Tagged ‘cPanel’

How to add MSSQL support in PHP5 cPanel CENTOS

Thursday, June 2nd, 2011

If you want to add MSSQL support in PHP5 cPanel CENTOS, follow the next steps:

1. First, we need to install FreeTDS
wget ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz
tar -zxvf freetds-stable.tgz
cd freetds-*

2. Begin the configuration process:
./configure --prefix=/usr/local/freetds --with-tdsver=8.0 --enable-msdblib --enable-dbmfix --with-gnu-ld

Note
Use tdsver=8.0 if you have SQL 2000/2005, tdsver=7.0 if you have SQL 7.0….

3. Compile FreeTDS
make && make install

4. Add the following line in the file /etc/ld.so.conf :
include /usr/local/freetds/lib

5. Run the following command
ldconfig -v

6. Add mssql to compile options of EasyApache
nano /var/cpanel/easy/apache/rawopts/all_php5
and add:
--with-mssql=/usr/local/freetds

7. Run /scripts/easyapache or build it from WHM. You don’t need to select any additional options here. Just build it. Once the build completes, you should now be able to use PHP’s MSSQL connector functions.

Note
If you are running a 64bit OS and get an error about configure: error:
Could not find /usr/local/freetds/lib64/libsybdb.a|so
then you need to do the following:


ln -s /usr/local/freetds/lib/libsybdb.so.5 /usr/lib64/libsybdb.so.5
ln -s /usr/local/freetds/lib/libsybdb.so.5 /usr/local/freetds/lib64/libsybdb.so
ldconfig -v

Internal Server Error Mailman cPanel

Wednesday, May 18th, 2011

If you have

Internal Server Error

while accessing :

http://SITE-URL/mailman/admin/LIST-NAME

you have to fix some permission problems in the mailman.

chmod 02755 -R /usr/local/cpanel/3rdparty/mailman
/usr/local/cpanel/3rdpart/mailman/bin/check_perms -f
chmod 02775 -R /usr/local/cpanel/3rdparty/mailman/logs

That’s it!

How to install Memcache in cPanel?

Tuesday, September 28th, 2010

Take a coffee, this is going to be a long process.

Step 1: Configure Apache
Login to cPanel and start EasyApache. At the Exhaustive Option List choose Memcache. Compile Apache & Restart it.

Step 2: Memcache requires LibEvent
LibEvent can be downloaded from Monkey.org. Download the last 1.4.x available version.

wget http://monkey.org/~provos/libevent-1.4.14b-stable.tar.gz
tar xvfz libevent-1.4.14b-stable.tar.gz
cd libevent-1.4.14b-stable
./configure; make; make install

Step 3: Register LibEvent

nano /etc/ld.so.conf.d/libevent-i386.conf

Add the following text inside:

/usr/local/lib/

and at last, run:

ldconfig

Step 4: Compile and install Memcache (deamon)
Now you can install Memcache with the last version from their site.

wget http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz
tar xvfz memcached-1.4.5.tar.gz
cd memcached-1.4.5
./configure; make; make install

Step 5: Install PHP extension for Memcache
Normall, you should be able to do this from cPanel but i get a compiling error. So here is an alternative:

wget http://pecl.php.net/get/memcache-3.0.3.tgz
tar xvfz memcache-3.0.3.tgz
cd memcache-3.0.3
phpize
./configure
make
make install

Edit /usr/local/lib/php.ini

nano /usr/local/lib/php.ini

and copy paste at the end of the file:

extension=memcache.so

and at last, restart Apache:

service httpd restart

Step 6: Run Memcache as a deamon on the startup files

nano /etc/memcached.conf

and add inside:

#Memory a usar
-m 16
# default port
-p 11211
# user to run daemon nobody/apache/www-data
-u nobody
# only listen locally
-l 127.0.0.1

create the startup files

touch /etc/init.d/memcached
chmod +x /etc/init.d/memcached

and add inside it

nano /etc/init.d/memcached

the following text

then run:

touch /usr/local/bin/start-memcached
chmod +x /usr/local/bin/start-memcached

and add inside the following text

Now, let’s test the scripts:

/etc/init.d/memcached restart

and review if the conf file is parsed ok:

ps aux | grep memcached

and last, add memcached as autostart deamon

/sbin/chkconfig memcached on
/sbin/chkconfig --list | grep memcached

it should output:

memcached 0:off 1:off 2:on 3:on 4:on 5:on 6:off

Step 7: Test Memcache in PHP
Create the memcache.php file and add this text
You should have in the browser:

String to store in memcached.

Increase phpmyadmin upload size in cPanel

Thursday, September 23rd, 2010

Changing the settings in php.ini through cPanel will affect only the accounts on the site but not the tools used in cPanel such as PHPMyAdmin.

If you want to increase the upload size or change settings of php for PHPMyAdminyou need to follow the next steps in SSH:


nano /usr/local/cpanel/3rdparty/etc/php.ini

and change
upload_max_filesize = 150M
post_max_size = 150M

then run in SSH

/usr/local/cpanel/bin/install_php_inis
service cpanel restart

Problem using PEAR ping command

Tuesday, July 7th, 2009

If you use cPanel and you get the following error when calling PING from PEAR:


Warning: popen() has been disabled for security reasons in /usr/lib/php/OS/Guess.php on line 242


Warning: fgets(): supplied argument is not a valid stream resource in /usr/lib/php/OS/Guess.php on line 243


Warning: pclose(): supplied argument is not a valid stream resource in /usr/lib/php/OS/Guess.php on line 252


Warning: exec() has been disabled for security reasons in /home/dev7sof/php/Net/Ping.php on line 243 unable to locate the ping binary

then in WHM -> PHP Configuration -> Switch to Advanced Mode -> remove from disable_functions the functions exec and popen

and save the new configuration.

Ping not working in cPanel

Tuesday, July 7th, 2009

If you try to run ‘ping’ as unprivileged user and you get the following message:

#ping www.google.com
ping: icmp open socket: Operation not permitted

then as root, run the following command:

#chmod +s ping

PEAR in cPanel

Monday, July 6th, 2009

In order to configure PEAR with cPanel you need to follow these steps:

1. In the WHM you need to be sure that you have configured Apache with PEAR.
2. If PEAR is not active in Apache go to easyApache and in Exhaustive List of Modules, check “PEAR” and compile Apache again.
3. Now, every normal user in cPanel will have the option to select the packages they want from their cPanel -> Software/Services -> PHP PEAR Packages.
4. (Additional) If an user doesn’t have the option at Step 3, be sure that in WHM -> Software -> Module Installers -> you have installed PEAR.
5. (Additional) If you get the following error:

PEAR configuration files "/.pearrc", "/usr/etc/pear.conf" does not exist

copy pear.conf from /etc/pear.conf -> /usr/etc/pear.conf

How to install Subversion client on cPanel

Thursday, June 18th, 2009

You can do it in console with:

# yum install subversion

and then you may get this error:

Error: Missing Dependency: perl(URI) >= 1.17 is needed by package subversion

To solve this do the following:
#wget ftp://ftp.pbone.net/mirror/archive.fedoraproject.org/fedora/linux/releases/7/Everything/i386/os/Fedora/perl-URI-1.35-3.noarch.rpm
# rpm -i perl-URI-1.35-3.noarch.rpm
# yum install subversion

That’s it subversion client is successfully installed on your server you can check it using following command.
#svn --version