Archives

Set up an Apache+PHP+MySQL local environment

You want to have a local Apache web server to test your new site? We’ll show you how to setup a web server and an MySQL server using XAMPP. XAMPP is a software that will install Apache+PHP+MySQL on your computer. Of course, you can download Apache, PHP and MySQL and install them by yourself, but using a suite like XAMPP will make the things much easier.

This tutorial is for XAMPP on Windows OS. XAMPP is also available for Linux and Max OS.

So, the steps to install the Apache+MariaDB(MySQL) development environment are:

1.Download XAMPP from https://www.apachefriends.org/index.html (the Windows Installer is about 110MB)

XAMPP Site

2. Install XAMPP. During the installation, choose the components you want to install.

XAMPP Installer Components

3. Start XAMPP Control Panel. 

4. Start the modules you want to run – in our case Apache(which includes PHP) and MySQL.

XAMPP Control Panel

You can now access the web server on your web browser at http://localhost/. The root folder of the web server is c:\xampp\htdocs\ In this folder you will put your site’s files.

To manage the database server go to http://localhost/phpmyadmin/. phpMyAdmin is a graphical tool that allow you perform various database operations.

And the video tutorial:

Resources: https://www.apachefriends.org/index.html

Share this post:

How to check server information in cPanel

Ever wanted to check your web hosting account details? Like Apache Web Server, MYSQL, PHP versions? cPanel allow you to examine these details. The steps are:

  1. Log into your cPanel account (you can find the cPanel username and password in the Welcome email you received from your host)
  2. On the right side of the cPanel click the Server Information link
  3. A new page will load where you can see a lot of details about your web hosting account, like: Apache, PHP, MySQL, PERL, cPanel versions; server load, status of the server services.
cPanel Server Information
cPanel Server Information

An example of some server details for your web hosting account that you can see in cPanel:

Item Detail
Hosting Package default
Server Name w08
cPanel Version 62.0 (build 17)
Apache Version 2.4.25
PHP Version 7.0.17
MySQL Version 10.1.22-MariaDB
Architecture x86_64
Operating System linux
Shared IP Address 162.255.100.100
Path to Sendmail /usr/sbin/sendmail
Path to Perl /usr/bin/perl
Perl Version 5.16.3
Kernel Version 2.6.32-042stab117.14

Check out the video we made to show you how easy is to check the server information in cPanel:

All our shared and reseller plans comes with cPanel. cPanel is a tool that allows you to manage many aspects of your web hosting account.
Share this post:

How to change the PHP version of your domain in cPanel

It’s always a good idea to use the latest version of PHP. For some time 2-3 PHP versions will be supported, but in the end the old ones will be discontinued. So, whenever possible, use the latest version.
We will show below how to change the PHP version for your site from cPanel.

cPanel MultiPHP Manager Interface
cPanel MultiPHP Manager Interface

The steps are:

  1. Log into your cPanel account.
  2. Go to MultiPHP Manager under the Software Section
  3. Select the domain for which you want to change the PHP version.
  4. From the right drop down list select the desired PHP version. If you choose the inherit option the site will use the default PHP version which is listed at the top of the page.
  5. Click the Apply button. The site is using now the PHP version you selected.
Some hosts may block this cPanel feature for end users. If you don’t see this feature in cPanel contact your host.

Please check now the video tutorial. You will also see how to check your current PHP version.

For more details of the PHP function used this tutorial check PHP: phpversion – Manual
Share this post:

How to list compiled PHP Modules

Sometimes is useful to see what modules are compiled in your PHP installation.
Let’s see how we can check this both on the server/root level and on the user level.

1. On the server/root level
On the server level, you can use the command php -m

root@web [~]# php -m
[PHP Modules]
Core
ctype
curl
date
dom
filter
ftp
gd
hash
iconv
imap
ionCube Loader
json
libxml
mbstring
mcrypt
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
SimpleXML
soap
SPL
sqlite3
standard
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache
the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured)

root@web [~]#

An improvement of the above command is to list the version of each module. We will use the command:

root@web [~]# php -r 'foreach (get_loaded_extensions() as $ext) echo "$ext : version " . phpversion($ext) . "\n";'
Core : version 7.0.16
date : version 7.0.16
libxml : version 7.0.16
openssl : version 7.0.16
pcre : version 7.0.16
zlib : version 7.0.16
filter : version 7.0.16
hash : version 1.0
pcntl : version 7.0.16
readline : version 7.0.16
Reflection : version 7.0.16
SPL : version 7.0.16
session : version 7.0.16
standard : version 7.0.16
ctype : version 7.0.16
curl : version 7.0.16
dom : version 20031129
ftp : version 7.0.16
gd : version 7.0.16
iconv : version 7.0.16
imap : version 7.0.16
json : version 1.4.0
mbstring : version 7.0.16
mcrypt : version 7.0.16
mysqlnd : version mysqlnd 5.0.12-dev - 20150407
PDO : version 7.0.16
Phar : version 2.0.2
posix : version 7.0.16
SimpleXML : version 7.0.16
soap : version 7.0.16
sqlite3 : version 0.7-dev
tokenizer : version 7.0.16
xml : version 7.0.16
xmlwriter : version 7.0.16
xsl : version 7.0.16
zip : version 1.13.5
mysqli : version 7.0.16
pdo_mysql : version 7.0.16
pdo_sqlite : version 7.0.16
wddx : version 7.0.16
xmlreader : version 7.0.16
xmlrpc : version 7.0.16
ionCube Loader : version
Zend OPcache : version 7.0.16
root@web [~]#

2. How to check loaded extensions as a user
Create and run a PHP file with the following content :

<?php
foreach (get_loaded_extensions() as $ext) echo “$ext : vers ” . phpversion($ext) . “</br>”;
?>

Yo will get a list of installed extensions alongside with their versions. To check if a specific extension is loaded, use the PHP function extension_loaded().

More info at PHP.net for the functions get_loaded_extensions() and extension_loaded()
Share this post:

Update cURL for EasyApache 4 to the latest version

EasyApache 4 from the cPanel environment is using a very old curl version. You may have issues with shop carts like WHMCS which gives you the following error message when going to Help->System Health Status.

The message states:

You currently have version 7.29.0 of cURL installed. This version is known to have security issues. Please update to the latest cURL and ensure it is greater than 7.35.0.

First let’s check the present PHP 7 curl version:

root@web [~]# php -r '$info = curl_version();echo $info["version"]."\n";'
7.29.0
root@web [~]#

Using the instructions from this cPanel Feature Request we will update curl to the latest version.
1. Make a backup copy of the file /etc/yum.repos.d/EA4.repo
cp /etc/yum.repos.d/EA4.repo /etc/yum.repos.d/EA4.repo.bak

2. Edit the file /etc/yum.repos.d/EA4.repo
Comment out the “mirrorlist” line and add one of the following lines according to your operating system.
CentOS 6 – 32bit: baseurl=http://ea4testing.cpanel.net/CentOS/6/EA4/i686/
CentOS 6 – 64bit: baseurl=http://ea4testing.cpanel.net/CentOS/6/EA4/x86_64/
CentOS 7 – 64bit: baseurl=http://ea4testing.cpanel.net/CentOS/7/EA4/x86_64/

3.Run the “yum update” command.
With this action, about 80 packages were updated on our test server. Let’s check again the PHP curl version

root@web [~]# php -r '$info = curl_version();echo $info["version"]."\n";'
7.53.1
root@web [~]#

As you can it see we have now the latest version. It will be released to all EA4 systems during next week. Also, the WHMCS warning message is gone.

Update 21 March 2017 : the new curl version is available to all EA4 systems.

Share this post:
Page 1 of 2
1 2