How to install PEAR for PHP in Linux


Cheap reseller Hosting


Install PEAR for PHP in Linux

 

-install-PEAR-for-PHP-in-Linux 

                 PEAR is a structured library of open-source code for users of PHP. When pear is not installed in your server, then install it. You can easily install PEAR for php in Linux

In this article we will give you how to install PEAR for php in Linux. Follow the steps for Installing PEAR.

Step 1 : Download the installation php file.

                     http://pear.php.net/go-pear

Step 2 : Rename to php file by using following command.

cp go-pear go-pear.php

Step 3 : Run the php script.

Then, Windows Command Prompt to start the installation.

Step 4 : You can install php various extensions by using following command.

pear install package

 

After installing PEAR, you can install modules by going to the PEAR admin at example :-

hostripples.com/pearadmin, where hostripples.com is your domain name.

 

 


Cheap web Hosting


Unable to establish a PHP session – PHPMyAdmin error


Cheap reseller Hosting


phpmyadmin error

PHPMyAdmin error :

Do you ever come across the following error when you access PHPMyAdmin from cPanel.

 

“Access Denied Unable to establish a PHP session. If you believe that this is in error or inadvertent, contact your system administrator and ask them to review your server settings.”

 

Normally, you will get this error when the permission or ownership of the tmp folder for this user is wrong. That is, make sure the ownership of /home/$username/tmp folder has ownership set to $user and permission as 755. If it is not, you will face the same problem.

 

Solution :

 

Step 1 : Login to the server via SSH as root.

Step 2 : Check the permission and ownership of /home/$user/tmp folder.

Step 3 : Set ownership as $user by using following command

# chown $user. /home/$user/tmp

Step 4 : Set permission of the tmp folder to 755 by using following command

#chmod 755 /home/$user/tmp

.
.
.
.
.
.
.
.

 

That’s it!!!

$user can be replaced with your respective username.

 

 


Cheap web Hosting


Installing LAMP On Linux Mint


Cheap reseller Hosting


Installing LAMP (Linux, Apache, MySQL and PHP) On Linux Mint. 

LAMP stands for Linux, Apache, MySQL, PHP. How to install Linux the L of LAMP.

LAMP_ashishkale_in

Install Apache

To start off we will install Apache.

1) Open up the Terminal

(Applications > Accessories > Terminal)

2) Copy/Paste the following line of code into Terminal and then press enter

sudo apt-get install apache2

3) Type you’re password, and then press enter.

The page should display the words

.

.

.

.

“It works!” 

 

Testing Apache

 

To make sure everything installed correctly we will now test Apache to ensure it is working properly.

1) Open up any web browser and then enter the following line.

http://localhost/

2) You should see a folder entitled apache2-default/.

3) Open it and you will see a message saying 

.
.
.
.
“It works!”, congrats to you!

 

Install PHP

PHP is an open source web scripting language that is widely use to build dynamic webpages.

To install PHP

1) Open up the Terminal

(Applications > Accessories > Terminal)

2) Type in this command

sudo apt-get install php5 libapache2-mod-php5

After you answer yes to the prompt twice, PHP will install itself.

3) It may also be useful to add php to the directory index, to serve the relevant php index files

sudo nano /etc/apache2/mods-enabled/dir.conf

 

Test PHP

To ensure there are no issues with PHP let’s give it a quick test run.

1) Open up the Terminal

(Applications > Accessories > Terminal)

2) Type in this command

sudo gedit /var/www/testphp.php

This will open up a file called phptest.php.

3) Copy/Paste this line into the phptest file:

<?php phpinfo(); ?>

4) Save and close the file.

5) Now open you’re web browser and type the following into the web address:

http://localhost/testphp.php

The page should look
.
.
.

Congrats you have now installed both Apache and PHP!

 

Install MySQL

To finish this guide up we will install MySQL. MySQL is a powerful database management system used for organizing and retrieving data

To install MySQL,

1) Open terminal and type in these commands

sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

During the installation, MySQL will ask you to set a root password. If you miss the chance to set the password while the program is installing, it is very easy to set the password later from within the MySQL shell.

2) Once you have installed MySQL, we should activate it with this command

sudo mysql_install_db

3) Finish up by running the MySQL set up script

sudo /usr/bin/mysql_secure_installation

4) The prompt will ask you for your current root password.

Type it in.

5) Enter current password for root (enter for none)

OK,

.

.

.

successfully used password, moving on…


Cheap web Hosting


How enable HTML files to display php code


Cheap reseller Hosting


 When writing content for your site, you typically store them in either html or php files. The basic files, particularly on Linux servers like the ones used for our hosting accounts, are either generally either html (files ending in the extension .html or .htm) or php (files ending in the extension .php) files. HTML files are created with markup tags and these files are not processed or parsed by the server. Php files, on the other hand, are parsed and processed by the server before being displayed in html format to the client browser. Php is a programming style language used to create pages that are processed and served from the server. Php files can always read and display HTML code, but HTML does not automatically parse php code. To do so, you will need to make adjustments to your .htaccess file.  enable_Html_file copy 

 Enable HTML files to display php code

1) Log into your cPanel

2) Using the File Manager, navigate to the root folder for the domain you want to work with

3) Set the Show Hidden Files option as you will be working with the .htaccess file

4) If there is not one for the domain, you will need to create a new one

5) Edit the file by highlighting the file

6) Click on the Edit icon from the toolbar at the top of the page

5) This brings you to the cpanel file editor. You will want to insert the following line of code at the top of the .htaccess file.

AddType application/x-httpd-php5 .html .htm .php

6) Then, Click the Save Changes button in the upper right corner of the screen.

7) You are now able to place php code sections into your html files and have them display.

8) Look at the before and after shot to see how the code affects a page with php in it.

 


Cheap web Hosting


What is PHP?


Cheap reseller Hosting


What is PHP? 

PHP

 PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. In an HTML document, PHP script (similar syntax to that of Perl or C ) is enclosed within special PHP tags. Because PHP is embedded within tags, the author can jump between HTML and PHP (similar to ASP and Cold Fusion) instead of having to rely on heavy amounts of code to output HTML. And, because PHP is executed on the server, the clientcannot view the PHP code.

PHP can perform any task that any CGI program can do, but its strength lies in its compatibility with many types of databases. Also, PHP can talk across networks using IMAP, SNMP, NNTP, POP3, or HTTP.

How to update  PHP version? 

1) To update Apache’s instance of PHP, run the /usr/local/cpanel/scripts/phpup script from the command line.
2) To change the version of Apache’s instance of PHP, run EasyApache in WHM (Home >> Software >> EasyApache (Apache Update)) or run the /usr/local/cpanel/scripts/easyapache script on the command line.
How do I update the instance of PHP that cPanel uses?

1) The system uses RPM to update PHP. For more information, read the rpm.versions documentation.

If I install a custom instance of PHP, will it work with cPanel & WHM?

The system uses RPM to update PHP. For more information, read the rpm.versions documentation.


Cheap web Hosting


What is suPHP ?


Cheap reseller Hosting


What is suPHP ?

suphp_logo

suPHP is a tool for executing PHP scripts with the permissions of their owners or a program that controls who can access certain files. All scripts executed on the server need to be authorized to run on the server. This enhances security by not running scripts as the web server user (nobody) or as root. So even if there is a vulnerable php script installed, it can at most execute with the permissions of the non-privileged user you choose for it to use.

PHP scripts are interpreted by suPHP and suPHP then calls the php interpreter as the specified user and interprets the scripts as that user.

1) Log into the WHM

2) Go to Main » Software » EasyApache (Apache Update).

3) Leave Previously Saved Config checked and select Start Customizing Based on Profile.

4) For security reason we recommend selecting the latest versions of Apache and PHP on the next three steps unless you have good reason to stick with an older version.

5) will have a screen with quite a few options on it, the one we are concerned about is the second option SuPHP. Tick the checkbox here, scroll down

6) click Save and Build.

Why use suPHP?

 suPHP is of great importance to ensure a safe environment for running applications and to make PHP-based applications such as Drupal more user-friendly. To be specific, users install or upload any template via Drupal without suPHP, their template files can be edited or deleted by any user at random. But for scripts equipped with a suPHP server, their template files are owned by the account holder and admin user.

Moreover, as most of the third party applications ask for some certain folders to have the permissions of 777, hackers with the 777 permission are able to upload malicious files into user’s account which probably affects the security of the files. As to suPHP users, there is no need to have the 777 permissions and an automated error message will appear when somebody tries to approach the file through 777 permissions.

 


Cheap web Hosting