Common PHP.ini directives list for Apache htaccess files

Maximum Execution Time and Maximum Input Time

php_value max_execution_time 300
php_value max_input_time 300

Max Upload file size and Max POST data size

php_value upload_max_filesize 20M
php_value post_max_size 21M

Output buffering toggle

php_value output_buffering on
# OR
php_value output_buffering 16384

Expose PHP signature – toggle

php_value expose_php on

Maximum Input variables

php_value max_input_vars 1500

Maximum Memory Limit for PHP

php_value memory_limit 1256M

Magic Quotes toggle

php_value magic_quotes_gpc on

Register Global Variables – useless now

register_globals = off  
#removed as of php 5.4

Allow remote URL in fopen

php_value allow_url_fopen on

Max Execution Time for php scripts

php_value max_execution_time 1000

Set Timezone for PHP datetime functions

php_value date.timezone "Europe/Paris"
php_value date.timezone "Asia/Kolkata"

More at: http://www.php.net/manual/en/timezones.php

Error Logging Settings

php_value log_errors On
php_value error_log /path/filename
php_value display_errors on
php_value display_startup_errors on

Complete List of INI directives:

http://www.php.net/manual/en/ini.list.php

How to repair a MySQL database?

Hello! Good to see you.

This is going to be a very important article because we are about to discuss  “How to repair a MySQL database?”

Why repair MySQL Database?

Databases can become corrupted for any number of reasons, from software defects to hardware issues.

If this occurs, you can try to repair the database. Wondering how to do it? Just follow this article.

REPAIRING MYSQL DATABASES:

Let’s see how to repair MySQL database through Linux and Windows command line.

Repair MySQL Database through Windows command line.

 

  • Log in to your Windows VPS using Remote Desktop.
  • Go to Start and locate the Command Prompt. Right-click Command Prompt and select Run as Administrator option.
  • At windows command prompt navigate to MySQL bin directory as follows.
    cd C:\Program Files\MySQL\MySQL Server 5.5\bin  //  Replace your MySQL bin directory path here.
  • Run the following command to start the MySQL prompt.
    mysql -u root -p
  • Enter MySQL root password when you are being asked.
  • You will see MySQL prompt appearing. Now, to display all databases, type following command at MySQL prompt:
    show databases;
  • Enter the following command to repair MySQL database.
    mysqlcheck -r [database] // Replace database name with your database name.

Repair MySQL Database through Linux Terminal.

 

  • Login to your Linux VPS using Secure Shell (SSH) and connect to MySQL from the command line.
    mysql -uUsername -p // Replace Username with your username.
  • Enter MySQL user password and hit Enter. You will see MySQL prompt appearing. Now, in order to display all databases, type following command at MySQL prompt.
    show databases;
  • mysqlcheck enables you to check databases without stopping the entire MySQL service. -r argument is used to repair the corrupted tables. mysqlcheck utility efficiently works on both MyISAM and InnoDB database engines. Enter the following command to repair MySQL database.
    mysqlcheck -r [database] // Replace database name with your database name.

 

So, we covered this issue for both Windows and Linux.

Lastly please check our other articles on various topics, that we tried to address.

Thank You.

How to install WordPress manually through Cpanel?

Hello Everyone.

This article is a step by step guide to install WordPress manually on your site through Cpanel.

Now you might ask, Why would you install it manually? when I can use the auto installer. Offcourse auto-installer is a great feature which reduces our effort.

These installers work great in many cases, but often stuff your site full of unwanted plugins and themes. In addition, these automated tools have a reputation for timing out or being completely unavailable at times, which can be frustrating if you’re on a deadline.

Also by doing manual work you get a better understanding of the system.

So, let’s start.

Wp manual installation: Steps.

Step 1: Download WordPress.

To be able to use WordPress CMS, you would need to download it from the official WordPress site. (WordPress.org)

Step 2: Upload WordPress.

Upload the downloaded package to your hosting account. This can be done in the following three ways:

  • Uploading via File manager. Within the File Manager, locate and navigate to that directory. From the toolbar of the cPanel, select “Upload” and browse for the file you downloaded from WordPress.org.
  • Uploading via FTP (file transfer protocol).
  • Uploading SSH (secure socket shell).
Step 3: MySQL DataBase. 

Create a MySQL database and user. For storing the data you will need to create a database which can be done using the below procedure.

  • Login to your Cpanel.
  • Under the database section, select the MySQL database wizard.
  • Create a Database and enter the database name. Click Next Step.
  • Create Database Users and enter the username and password. Click Create User
Step 4: Connect WP to DataBase. 

Now is the time to connect the database with WordPress. In order to do that fill up the details form step 3 in WordPress too.

  • On starting WordPress it will ask for important details to connect the database.
  • Enter the database username.
  • Enter the database password.
  • Choose the Database Host. You can get this info from your web host.

Submitting all this will connect your database to WordPress account.

Step 5: Script installation.

The last job is to execute the installation script from the installation page. You can find the script using either of the below URLs:

  • http://yourdomain.com/wp-admin/install.php
  • http://yourdomain.com/blog/wp-admin/install.php

That’s it. You have successfully installed WordPress to your site. Enjoy the best wp themes and plugins now.

I hope that this article may have helped you. We may talk about Softaculous in the near future so stay tuned.

Thank You.

How to add file paths in src attribute inside img tag

Hello Everyone.

This topic is pretty important because if you got this wrong, you won’t be able to show any images on your web page.

After uploading your HTML file & images you have to provide correct path for img src attribute

In the previous article, we saw ‘How to upload files and images to your web hosting.‘ You can think of this article as a continuation to that one.

So, let’s see ‘How to add file path in src attribute inside img tag?’

Src attribute inside image tag:

Login >> my website >> manage website >> file manager >> upload files now.

  1. Double click on your uploaded HTML file. It will open the code of your HTML file. 
  2. Now look for all the image tags in your code. (You can find it by “Ctrl + F” keyboard shortcut.)
  3. Now in the src attribute add/change the image path and save. 
  4. Correct image path has been added/changed. 

How to locate the correct path of the image?

Go to the uploaded image and click on view. You will be redirected to the URL where that image lies. 

Copy that URL and paste it in the src attribute of your img tag. (step 3 in the previous section.) 

if you have uploaded  images directly to Public_html folder then you have to write src attribute as follows: img src=”imagename.jpg”
or if you created a separate folder for images then you have to write src attribute as follows: img src =”foldername/imagename.jpg”

If your image and HTML folder lies in the:

The same folder than src attribute goes this way – “./imagename.jpg

Another folder than src attribute goes this way – “../foldername/imagename.jpg

Credit: Shahebaj khan

If anything is missed out, please let us know in the comment below.

Hope that we have been able to provide some value to you.

Thank You.

How to upload files to 000webhost?

Hello Everyone and welcome to tutes.in.

Today we are going to see ‘How to upload your images and HTML files to your web hosting.’

These are small things but could be confusing in the beginning, as it was to me.

One quick fact: 000web host is an open source project of Hostinger.

Let’s get back to the topic.

How to upload files to the web host?

Here is a step by step guide to uploading your file to the web host, specifically t0 000webhost.

  1. Login (Here) to your Cpanel. (Oh! that’s obvious.) 
  2. Go to my website from the drop-down menu in the top right corner. 
  3. Click on manage website. 
  4. Now go to the file manager. 
  5. There you get an option to upload your file. Click on ‘Upload files now.’ 
  6. Now you are on the page where all your data (file) is stored. Click on the ‘upload file icon.’
  7. Select files from your computer and upload to your desired path. 

If you are uploading a web page make sure to have your images and HTML file in the same folder. Or take care of src attribute in the image tag.

Credit: Shahebaj khan

So,  that’s it for this article. I will be back with another article, stay tuned.

Thank You.

Top CMS out there in 2018.

CMS:

A content management system is a software that helps us to manage our content and site.

You can literally manage everything from a blog to an e-commerce site, using CMS. You can manage an article if you have a blog, or manage your product if it is an e-commerce business.

It has made our life so easier that we just can’t imagine having a site without CMS. You can operate most CMS out there even if you have no prior technical knowledge.

Today we are going to talk about the top CMS in 2018, there features, flexibility and specifications because that’s what they are known for.

So, without any further delay let’s begin.

Top CMS:

  1. WordPress: This one goes without saying. Probably the best one out there. WordPress can make almost any kind of site either it is a blog, a real state site or an e-commerce. It can make anything under the sun. WordPress is the framework behind many of the websites and blogs you visit every day, including this one. .org Few of the key features are responsive design, social sharing features, multiple page styles, auto upgrade, and standard compliant coding. The one thing that makes it a CMS beast is plugins.
  2. Joomla: Joomla is a popular Content Management System. It is much more than just a powerful content management system. Besides, hundreds of extensions to enhance the functionality of any Joomla website, Joomla itself includes some powerful built-in features (or core features). Many times ranked as the 2nd best CMS after WP. zoomla Few key features are Rss, media manager, web links, search, banner management and, user management.
  3. Drupal: Drupal 8 takes an already terrific content management framework to ever greater heights for users, administrators, and developers. There’s a seriously sharp focus on user-friendliness, but the content presentation, new ways to create data structures, build APIs, multilingual capabilities, and the delivery of mobile accessibility out of the box? Drupal 8 brings those to the table too.  Few of the features are mobile first, multilingual ready, loading speed, javascript automated testing.
  4. Magento: Specific to make an e-commerce site. The large array of features is one of the main benefits of Magento. Through them, you can easily develop and manage a successful online store. Magento features like different payment engines and shipping options along with the international support and high security using an  SSL certificate will make your shop an attractive place for e-commerce.  The core features are checkout payment and shipping, analytics and reporting, marketing and promotional tools, and order management.
  5. OpenCart: OpenCart is an open-source shopping cart built on PHP/MySQL code. Distributed as a free eCommerce solution, OpenCart is a very user-friendly and effective platform that comes with a very intuitive and well-designed user-interface as well as a higher selection of extensions. Perfect for small businesses and medium-sized e-commerce stores, OpenCart is loaded with all the basic functions a user would need from an e-commerce solution.  Main features are, Product Reviews, Product Ratings, open source, multi-currency, automated image resize, 20+ payment gateways, and 8+ shipping methods.

One honorable mention is WIX. Very user-friendly having drag and drop interface.

SO, these were the top of 2018 CMS. You should choose one according to your needs.  Keep visiting for such more articles.

Thank You.

WordPress.com v/s WordPress.org : The difference.

WordPress:

The most popular CMS, yet there is one thing that keeps on confusing the newbies. And that is the difference between wordpress.com and wordpress.org.

I myself have been confused about the difference, which once made me choose the wrong one. (as per my needs.)

But I don’t want this to happen with you, hence here is an article to clear this thing out.

What’s the difference:

The very first difference is in the domain extension.

.org – organization (free for everyone)

.com – commercial.

This isn’t a hard and fixed rule, but you got the context.

The major difference:

The major difference is “who is hosting your site?” In wordpress.com your site is hosted by WordPress, whereas in wordpress.org you are hosting your site via a hosting provider.

WordPress.org

The WordPress software, located at WordPress.org, is a free, open source content management system. To use the WordPress.org software, you need to install it on a web server. And that’s the key difference between WordPress.com vs WordPress.org.

If you download WordPress from WordPress.org, YOU host it. You set it up with your own hosting provider and use it on your own website, which gives you a ton of flexibility. This is why WordPress.org is often also called self-hosted WordPress.

.org

WordPress.org has much better customization options. You’re able to install plugins, use custom website themes, and do just about anything you want with your site. You can also monetize your website however you want, which is great if you’re planning to make it a business.

WordPress.com

WordPress software located at wordpress.com is a blog website platform. This doesn’t need to be downloaded. You can have your site running right away just by signing up on the wordpress.com.

This is limited but free as long as you are ok with their branding. And if you want to the domain of your choice, pay for it. No plugin is allowed with a free version.

.com

With .com you won’t be able to install your own “plugins” or “themes” unless you pay for the expensive business plan. Plugins and themes are one of the most helpful things about the WordPress software because they make it easy to customize your site, so that’s a pretty big loss.

The final note:

Go with wordpress.org, if you want the best options and full control over your site.

I hope this was helpful to you. Thanks for reading.

Thank You

How to use VestaCP Cli Commands? – Linux

There are a lot of vestacp commands which are useful in automating things but you see error

sudo: v-list-sys-vesta-ssl: command not found

OR
something like this:

sudo /usr/local/vesta/bin/v-add-web-domain-ssl mage yourdomain
/usr/local/vesta/bin/v-add-web-domain-ssl: line 39: /func/main.sh: No such file or directory
/usr/local/vesta/bin/v-add-web-domain-ssl: line 40: /func/domain.sh: No such file or directory
/usr/local/vesta/bin/v-add-web-domain-ssl: line 41: /func/ip.sh: No such file or directory
/usr/local/vesta/bin/v-add-web-domain-ssl: line 42: /conf/vesta.conf: No such file or directory
/usr/local/vesta/bin/v-add-web-domain-ssl: line 45: format_domain: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 46: format_domain_idn: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 53: check_args: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 54: is_format_valid: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 55: is_system_enabled: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 56: is_system_enabled: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 57: is_object_valid: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 58: is_object_unsuspended: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 59: is_object_valid: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 60: is_object_unsuspended: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 61: is_object_value_empty: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 62: is_web_domain_cert_valid: command not found
cp: cannot stat '/yourdomain.crt': No such file or directory
cp: cannot stat '/yourdomain.key': No such file or directory
cp: cannot stat '/yourdomain.crt': No such file or directory
chmod: cannot access '/ssl/yourdomain.*': No such file or directory
cp: cannot stat '/ssl/yourdomain.crt': No such file or directory
cp: cannot stat '/ssl/yourdomain.key': No such file or directory
cp: cannot stat '/ssl/yourdomain.pem': No such file or directory
/usr/local/vesta/bin/v-add-web-domain-ssl: line 89: get_domain_values: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 90: get_real_ip: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 94: prepare_web_domain_values: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 97: add_web_config: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 110: increase_user_value: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 113: update_object_value: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 114: update_object_value: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 117: /v-restart-web: No such file or directory
/usr/local/vesta/bin/v-add-web-domain-ssl: line 118: check_result: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 120: /v-restart-proxy: No such file or directory
/usr/local/vesta/bin/v-add-web-domain-ssl: line 121: check_result: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 131: log_history: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 132: log_event: command not found

Solution

type this in command line (ssh)

export VESTA=/usr/local/vesta/

After that use any command like:

sudo /usr/local/vesta/bin/v-add-letsencrypt-domain <username> <maindomain.com> <domainalias.com*>

Dont use < or > or *
* means optional
< and > means replace your info with that


Complete command list : https://vestacp.com/docs/cli/

How to change PHP versions in VestaCP Ubuntu – Downgrade Upgrade 5.6, 7.1 and 7.2

For Downgrading 7.2 (default) to 7.1 PHP

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install libapache2-mod-php7.1 php7.1 php7.1-bcmath php7.1-bz2 php7.1-cgi php7.1-cli php7.1-common php7.1-curl php7.1-dba php7.1-dev php7.1-enchant php7.1-fpm php7.1-gd php7.1-gmp php7.1-imap php7.1-interbase php7.1-intl php7.1-json php7.1-ldap php7.1-mbstring php7.1-mcrypt php7.1-mysql php7.1-odbc php7.1-opcache php7.1-pgsql php7.1-phpdbg php7.1-pspell php7.1-readline php7.1-recode php7.1-snmp php7.1-soap php7.1-sqlite3 php7.1-sybase php7.1-tidy php7.1-xml php7.1-xmlrpc php7.1-xsl php7.1-zip
sudo a2dismod php7.2
sudo a2enmod php7.1
sudo service apache2 restart
sudo update-alternatives --set php /usr/bin/php7.1

Reference: Sandy B @ mysterydata.com

How to remove all tables from MySQL Database?

Connect to your mysql host and select the database to be used
example: use notfavoritedb; where notfavoritedb is your database name, and then enter the sql commands given below:

SET FOREIGN_KEY_CHECKS = 0;
SET GROUP_CONCAT_MAX_LEN=32768;
SET @tables = NULL;
SELECT GROUP_CONCAT('`', table_name, '`') INTO @tables
  FROM information_schema.tables
  WHERE table_schema = (SELECT DATABASE());
SELECT IFNULL(@tables,'dummy') INTO @tables;

SET @tables = CONCAT('DROP TABLE IF EXISTS ', @tables);
PREPARE stmt FROM @tables;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET FOREIGN_KEY_CHECKS = 1;
exit;

Reference: StackOverflow