If you are getting “(13)Permission denied: /home/username/public_html/logo/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://www.yourdomain.com/logo/index.html” error in  apache error logs file /usr/local/apache/logs/error_log as well as the site is showing 403 Forbidden Error.

Then first please check the permissions of your folder and .htaccess file because folder permision are most likely 755 and .htaccess permission 644 . To change permissions use : chmod 644 the_name_of_your_path after that still you are getting same problem,then might be Frontpage Extension problem.

* Login into your CPanel account
* Click on Frontpage Extensions icon
* Click on Reinstall extensions button beside your problem domain.
* Done.

The .htaccess pcfg_openfile: unable to check htaccess file problem  will be fixed.

Regards

Alex P

If you are getting following error while try to access Fantastico via cpanel >> Fantastico option then please proceed to following steps to fix it,

Error ::
Fantastico is not installed at the default location /usr/local/cpanel/3rdparty/fantastico. Either move the Fantastico directory from it’s current location to /usr/local/cpanel/3rdparty/fantastico OR enable ioncube loaders in WHM -> Tweak settings.

Solutions ::

  • first make sure ioncube installed on server as well as make sure it is enable in WHM -> Tweak settings.
  • Second you may want to try to update fantastico with cd /usr/local/cpanel/whostmgr/docroot/cgi/fantastico/scripts/ ; /usr/local/cpanel/3rdparty/bin/php cron.php
  • Third you may want to rebuild cpanel’s php with /scripts/makecpphp
  • Fourth you may want to try a cpanel update with /scripts/upcp –force

Regards

Alex P

eAccelerator is used improve performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution.
If  eAccelerator is installed on serverwide then it is enable for all account or you can enable it eAccelerator by makeing  a .htaccess file in your ‘htdocs’ directory, and add the following lines:
php_flag eaccelerator.enable 1
php_flag eaccelerator.optimizer 1

if you’d like to turn off eAccelerator for a particular directory, put the following in a .htaccess file in that subdirectory:

php_flag eaccelerator.enable 0
php_flag eaccelerator.optimizer 0

If php suexec is enabled on server then create php.ini file and following code in that file to disble eAccelerator.

eaccelerator.enable 0
eaccelerator.optimizer 0

Regards

Alex P

System Administrator

What is firebird

Firebird is an open source relational database offering many ANSI SQL-99 features that runs on Linux, Windows, and a variety of Unix platforms. Firebird offers excellent concurrency, high performance, powerful language support for stored procedures and triggers. It has been used in many production systems within a large number of commercial companies since 1981.

Steps to compile compile firebird module with php

1)Download the firebird module  to server

Cd /usr/src

wget http://nchc.dl.sourceforge.net/sourceforge/firebird/Firebird-2.0.3.12981-1.tar.bz2

2)Manually build and install the firebird module

tar -jxf Firebird-2.0.3.12981-1.tar.bz2

cd Firebird-2.0.3.12981-1

mv Firebird-2.0.3.12981-1 firebird

cd firebird

./autogen.sh; make;make install

3)Rebuild PHP along with the firebird

‘–with-interbase=/usr/src/firebird’ option.

When installing is finished, open the php.ini configuration file (located in /usr/local/lib/), and check if these lines exist (uncomment/modify them if necessary):

magic_quotes_sybase = On	; Use Sybase-style magic quotes (escape ' with '' instead of ')
extension=php_interbase.so

magic_quotes_sybase = On	; Use Sybase-style magic quotes (escape ' with '' instead of ')
extension=php_interbase.so

 4) check php module using php -m command

Regards

Stacy

System Administrator.

I was facing same error with one of my shared server last couple of week, apache was broke on server and getting following error in apache error logs file.

[emerg] (28)No space left on device: Couldn't create accept lock
[notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[notice] Digest: generating secret for digest authentication ...
[notice] Digest: done
[warn] pid file /etc/httpd/run/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[emerg] (28)No space left on device: Couldn't create accept lock

I checked disk space, or quota limit but everything was fine. I through it seem to apache semaphore problem

Apache can create the “accept lock” is with a semaphore. A semaphore is an inter-process communication tool that is used by Apache to communicate with it’s child processes. This error message may mean that Apache couldn’t create a new semaphore.

Check to see how many semaphores are currently in use. If Apache is running correctly, you should see something like this:

# ipcs -s

If Apache is stopped, and you still see these semaphores, then you can safely kill them by running this command for each semaphore id (in the second column)

$ ipcrm -s <semid> 

To destroy all semaphores, you can run this from the command line (with “apache” being the apache-user:

for semid in `ipcs -s | grep apachec | cut -f2 -d" "`; do ipcrm -s $semid; done

OR

ipcs -s | grep apache | perl -e ‘while (<STDIN>) { @a=split(/\s+/); print `ipcrm sem $a[1]`}’

OR

ipcs -s | grep nobody | perl -e ‘while () { @a=split(/\s+/); print `ipcrm sem $a[1]`}’
ipcs -m | grep nobody | perl -e ‘while (
) { @a=split(/\s+/); print `ipcrm -m $a[1]`}’

OR

for i in `ipcs -s | awk ‘/httpd/ {print $2}’`; do (ipcrm -s $i); done

How to increase semaphore limit

To view the current parameters:

ipcs -l

To change these parameters, modify the file /etc/sysctl.conf and add the following lines:

kernel.msgmni = 1024
kernel.sem = 250 256000 32 1024

Then load these settings with the command:

sysctl -p

Regards

StacyM

System Administrator

19
Sep

How to compile pdo_mysql module with php ?

   Posted by: admin   in Apache and PHP

Hello,

PDO_MYSQL is a driver that implements the PHP Data Objects (PDO) interface to enable access from PHP to MySQL 3.x and 4.x databases.

PDO_MYSQL will take advantage of native prepared statement support present in MySQL 4.1 and higher. If you’re using an older version of the mysql client libraries, PDO will emulate them for you.

Steps to compile compile pdo_mysql module with php

1) Download the PDO package to server

          # wget http://pecl.php.net/get/PDO

2) Manually build and install the PDO extension:

	  # tar xzf PDO-0.2.tgz
	  # cd PDO-0.2
	  # phpize
	  # ./configure
          # make
          # make install
          # echo extension=pdo.so >> /usr/local/php5/lib/php.ini

3) rebuild PHP along with the drivers for PDO_mysql.

CUSTOM_PHP_FLAGS=”–with-pdo-mysql” /scripts/easyapache

4) check php module using php –m command

Enjoys :)

14
Sep

301 Redirect

   Posted by: admin   in Apache and PHP

301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It’s not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it’s the safest option. The code “301″ is interpreted as “moved permanently”.

IIS Redirect

  • In internet services manager, right click on the file or folder you wish to redirect
  • Select the radio titled “a redirection to a URL”.
  • Enter the redirection page
  • Check “The exact url entered above” and the “A permanent redirection for this resource”
  • Click on ‘Apply’

ColdFusion Redirect

<.cfheader statuscode=”301″ statustext=”Moved permanently”>
<.cfheader name=”Location” value=”http://www.new-url.com”>

PHP Redirect

<?
Header( “HTTP/1.1 301 Moved Permanently” );
Header( “Location: http://www.new-url.com” );
?>

ASP Redirect

<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanently”;
Response.AddHeader(”Location”,”http://www.new-url.com/”);
%>

ASP .NET Redirect

<script runat=”server”>
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = “301 Moved Permanently”;
Response.AddHeader(”Location”,”http://www.new-url.com”);
}
</script>

JSP (Java) Redirect

<%
response.setStatus(301);
response.setHeader( “Location”, “http://www.new-url.com/” );
response.setHeader( “Connection”, “close” );
%>

CGI PERL Redirect

$q = new CGI;
print $q->redirect(”http://www.new-url.com/”);

Ruby on Rails Redirect

def old_action
headers["Status"] = “301 Moved Permanently”
redirect_to “http://www.new-url.com/”
end

Redirect Old domain to New domain

Create a .htaccess file with the below code, it will ensure that all your directories and pages of your old domain will get correctly redirected to your new domain.
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

Please REPLACE www.newdomain.com in the above code with your actual domain name.

In addition to the redirect I would suggest that you contact every backlinking site to modify their backlink to point to your new website.

Redirect to www

Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.domain.com
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

Please REPLACE domain.com and www.newdomain.com with your actual domain name.

What is Clientexec?

Clientexec is a robust client management software use for managing hosting clients, as well as many other types of clients, that offers the ability for monthly billing. CE Clientexec) also offers an area for your clients to create support tickets, and allows you to respond to the tickets as well. CE integrates with Paypal, Authorize.net, and many other 3rd party online payment processors. Here is the procedure on how to install ClientExec

You will have to buy the license for that from here
You will get the licencekey from them. Depending upon your server configuration you will have to download exect clientExec from here.

Detail of CE
For example if you have following configuration

- PHP versions between 4.3.0 and 5.0.5
- MySQL versions till 4.1

then you can download the CE ( clientExec Files from here)

wget http://download.powervps.com/clientexec/Clientexec.2.7.3.Ion.zip
wget http://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz

Now To install ClientExec:

- The first step is to create a database. (You need to create a mySQL database, database
username, and database password.)

- Upload the entire contents of the zip file to your server in BINARY mode.

- Apply any patches as needed.

- Change CHMOD permissions on the config.php file to 666.

- Also modify the config file as per your database configuration.

- Point your browser to http://domain.com/install.php

- After the installation is complete, delete or move the install.php file

That is it. You should have a clean install and ready to go.

READ the CHANGELOG.txt file

1) First step in any upgrade is to backup your database. You can do so using an application
like phpmyadmin which is commonly found with your hosting control panel utilities.
NOTE: We can not stress this step enough. We can not help you easily with any issues to
your data unless you have a backup before any upgrade.
2) Unzip the contents of your compressed ClientExec file.
3) FTP to your server, which contains the domain of your ClientExec installation.
4) Remove all of your files except for:
config.php
license.php - If upgrading from 2.2.x you do not need to keep your license file
uploads/files - Do not remove this folder if you have files in your files manager
5) Upload all the content files from the ClientExec zip file. Ensure that you do not overwrite
config.php or license.php
6) Visit http://yourceurl/install.php and click on Upgrade. Follow the steps until completion.
7) If you are getting any error o the above URL then please check that you have change the file permission to 666.
8) Delete install.php.

Upgrading Notes:
-If you see the install option available when you run the install.php script then you need to
check your config.php and ensure that you didn’t overwrite by mistake.
-If you are upgrading from beta 2.2.x then you do not need to keep your license.php file prior
to running the upgrade.
-After you have upgraded your version of CE you can now delete your license.php file.
-After you have upgraded your version of CE make sure you remove your install.php file.
-If after upgrading you find that you have unauthorized version installed message do not stress,
just follow the instructions below on obtaining a new license.
-After each upgrade go to admin->settings->3rd party invoices to ensure all plugins are synched
properly

You can have detail info for clientexec at following URLS:
http://www.clientexec.com/manual
http://www.clientexec.com/kb
http://www.ce-talk.com/

Hello,

If you trying to installed Zend optimize and ionCube Loader on plesk server .

After installing Zend 3.0.1 and ionCube Loader php -v returns this:
———————————————————————-
PHP Fatal error: [ionCube Loader] The Loader must appear as the first entry in the php.ini file in Unknown on line 0

Here solution of this problem

1) Please go to cd /etc/php.d/ directory , edit ioncube.ini file and comment following line

#zend_extension=/usr/lib/php4/ ioncube_loader_lin_4.3.so

2) Now open php.ini file and add following code

zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.0.1

zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.0.1

zend_optimizer.version=3.0.1

zend_extension=/usr/local/ioncube/ioncube_loader_lin_4.3.so

zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so

zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so

(Note : Depend of php veriosn please change ioncube_loader_lin_4.X.so file )

Problem fixed ……. :)

Enjoy ………………….

Regard’s

Alex P

System Administrator.

8
Jul

How do you repair a corrupt MySQL table?

   Posted by: admin   in MySql

Hello,

Error: Table ‘tbl_ name’ doesn’t exist databasename_tablesname.frm can’t open

If you get either of the following errors, it usually means that no table exists in the current database with the given name:

Table ‘tbl_name’ doesn’t exist

Can’t find file: ‘tbl_name’ (errno: 2)

A ) In some cases, it may be that the table does exist but that you are referring to it incorrectly:

Because MySQL uses directories and files to store databases and tables, database and table names are case sensitive if they are located on a file system that has case-sensitive filenames.

Even for file systems that are not case sensitive, such as on Windows, all references to a given table within a query must use the same letter case.

B ) In some cases, it may be that the table exist but same error occurs then

1 ) Check the permission and ownership of database i.e. it should be same below

drwx—— 2 mysql mysql cpanelusername_dbname.

2) If the permission are corrects but same error occurs then it seems that your database table may be corrupts then there are following way to repair the DB

a) Go to whm >>SQL Services >> Repair a Database >> select database name and click Repair Database.

b) Go to cpanel >> mysql section MySQL Account Maintenance >> search database then click on Repair.

C) You can repair it though shell when mysqld server is running

i) login in mysql to that particular user by using following command

mysql>mysql –u databaseusername –p databasename

ii) select particular database

mysql> use databasename;

iii) Check whether database table is corrupted or not if following command output shows null value then it should be corrupts otherwise it is fine

mysql>show table status like ‘table name’\G; Or
mysql>check table tablename ;

iv)If it is corrupts then use the following command to repair that particular database table.

mysql>repair table tablename;

D] You can repair it though shell when mysqld server is not running

Repairing MyISAM mySQL Tables/Databases:

# cd /var/lib/mysql/DBNAME

# myisamchk tablename.MYI

Repairing ISAM mySQL Tables/Databases:

# cd /var/lib/mysql/DBNAME
isamchk tablename.MYI
where

-c –> check database is corrupted or not
-r –> recorver
-o –> optimise the database