MilesWeb Hosting Forum

Please login or register.

Login with username, password and session length



SMF - Just Installed!

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Manish

Pages: [1]

Sometimes you get below errors on the CodeIgniter website.

A PHP Error was encountered

Severity: Warning

Message: mkdir(): Invalid path

Filename: drivers/Session_files_driver.php

Line Number: 117


File: /home/user/public_html/index.php
Line: 295
Function: require_once
An uncaught Exception was encountered

Type: Exception

Message: Session: Configured save path '' is not a directory, doesn't exist or cannot be created.

Filename: /home/user/public_html/system/libraries/Session/drivers/Session_files_driver.php

Line Number: 119


File: /home/user/public_html/index.php
Line: 295
Function: require_once
A PHP Error was encountered

Severity: Warning

Message: fopen(f7a5103144e842f8cafeb2355869ca11dd7ecf48): failed to open stream: Permission denied

Filename: drivers/Session_files_driver.php

Line Number: 156


To fix the issue follow below steps:

1. Open the config.php file in the directory Codeigniter
2. Find the following code:

$config['sess_save_path'] = NULL;

3. Change to:

$config['sess_save_path'] = sys_get_temp_dir();

Your website should be working fine.

That's it  :)

Errors and Solutions / How to enable errors on CodeIgniter website
« on: January 12, 2017, 02:02:03 PM »

Sometimes you get black page on CodeIgniter website and no errors generated on the server. In such cases you can view the exact errors by enabling the display_errors from index.php file.

Open index.php file and add below code at the end of file

ini_set('display_errors', 1);

After that access the website and it will show you exact errors.

How To's / Re: Nginx Wordpress Permalinks issue
« on: January 12, 2017, 09:22:46 AM »

If your blog is in subfolder like http://domainname/subfolder it does not work and shows "Page not found error. In such issues you will need to add separate permalink entry in configuration file on Webuzo.

Go to the path of ngnix configuration: /usr/local/apps/nginx/etc/conf.d
Open file "common" and add the below entry at the end of the file:

location /subfoldername/ {
    try_files $uri $uri/ /subfoldername/index.php?$args;

Then restart the ngnix service on the server.

Add entry for each subfolder in which your blog is created.

Hello All,

In Webuzo with ngnix you can enable Gzip compression and Leverage browser caching for particular domain by adding extra configuration file of domain. You will need to create configuration files like gzip.conf and leverage.conf and add below code.

Gzip compression code:

# Enable Gzip
  gzip  on;
  gzip_http_version 1.0;
  gzip_comp_level 2;
  gzip_min_length 1100;
  gzip_buffers     4 8k;
  gzip_proxied any;
    # text/html is always compressed by HttpGzipModule

  gzip_static on;

  gzip_proxied        expired no-cache no-store private auth;
  gzip_disable        "MSIE [1-6]\.";
  gzip_vary           on;

Leverage browser caching:

location ~*  \.(jpg|jpeg|png|gif|ico|css|js)$ {
expires 365d;

After that Follow below steps:

1: Login to Webuzo panel and go to Domain >> Extra Configuration

2: Select the Domain for which you want to ADD Extra Configuration File.

3: Select the Webserver for which you want to ADD Extra Configuration File.

4: Populate the input field with the location of your configuration file.

5: Click on Add record button.

6: Repeat above steps for other configuration file.

7: Then restart the nginx service on the server.


That's it  :)

How To's / Nginx Wordpress Permalinks issue
« on: December 02, 2016, 04:32:18 PM »

On Webuzo with nginx, wordpress permalink doesn't work by default. Due to that sub-pages or internal links don't work and they show 404 errors. In such situation we will need to add extra configuration file of domain in nginx.

For that create a custom config file on your computer and add below content in it.

try_files $uri $uri/ /index.php?q=$uri&$args;

Example: Create permalink.conf file and add provided code in it.

After that Follow below steps:

1: Login to Webuzo panel and go to Domain >> Extra Configuration

2: Select the Domain for which you want to ADD Extra Configuration File.

3: Select the Webserver for which you want to ADD Extra Configuration File.

4: Populate the input field with the location of your configuration file.

5: Click on Add record button.

6: Then restart the nginx service on the server.


That's it. All sub-pages and links should be working fine  :)

Errors and Solutions / PHP extensions not loading in phpinfo
« on: July 11, 2016, 09:09:37 AM »

Sometimes on cloudlinux server(Cpanel with cloudlinux) PHP extensions doesn't showing in phpinfo even though they are complied with PHP and showing in PHP molues lists. In this case you will need to add particular PHP extension manually by using tool "selectorctl".

"selectorctl" is a new tool that replaces cl-selector (which is deprecated and should not be used anymore) and piniset. It is available starting with CageFS 5.1.3.

Follow below steps:

1) Check all available PHP verisions and native version on server using below command:
[root@ ~]# selectorctl --summary --show-native-version
4.4 e -
5.1 e -
5.2 e -
5.3 e -
5.4 e -
5.5 e -
5.6 e -

2)Check extension installed for particular PHP version:
[root@~l]# selectorctl --list-extensions --version=5.6
- apcu
- apm
- ares
- bcmath
- big_int

3)Suppose if you wish to add extension "fileinfo" to version PHP 5.6 run below command:
[root@~]# selectorctl --enable-extensions=fileinfo --version=5.6

That's it, now check phpinfo file and fileinfo extension will show in it.


If you face issue with emails getting stucked in mail queue on cpanel server and receive error "All deliveries are handled by MailScanner" when you run mail queue manually then there is issue with the MailScanner installed on the server.

Following steps will fix the Mailscanner issue and can be run in SSH at any time without harm:

  • /scripts/buildeximconf
  • service exim restart
  • /usr/mscpanel/
When you run above commands on the server result should be as below.

[root@~]# /scripts/buildeximconf
Configuration file passes test!  New configuration file was installed.
/etc/ installed!
SPF is disabled in exim or unavailable, enabling SPF for SpamAssassin
Mail Scanner exim.conf updating...`/etc/exim.conf' -> `/etc/exim_outgoing.conf'
Refreshing SMTP Mail protection.
SMTP Mail protection has been disabled.  All users may make outbound smtp connections.

[root@~]# service exim restart
Shutting down exim:                                        [  OK  ]
Shutting down spamd:                                       [  OK  ]
Starting exim:                                             [  OK  ]
Starting exim-outgoing:                                    [  OK  ]
Starting spamd:                                            [  OK  ]

Generating exim split spool directories...
Updating MailScanner.conf with sensible values...
Shutting down MailScanner daemons:
         Waiting for MailScanner to stop..
Starting MailScanner daemons: OK

Once you done this your emails should be working fine.

That's All  :)

Errors and Solutions / The traceroute problem in CSF servers
« on: June 06, 2016, 07:44:04 PM »

In the hosting industry the traceroute   tool is a very common tool using for servers simple network status. If we install CSF in any server, the traceroute  fails. So admins will think there will be some problems. As from a security view it is good to block such packets. Even though it will be good to enable the  UDP_IN port rang  33434:33523 as open in default CSF configuration.

Open csf configuration file and search for UDP_IN

# To allow incoming traceroute add 33434:33523 to this
   UDP_IN = "20,21,53,953,33434:33523"

After that restart the csf firewall on server.
# csf -r

Traceroute will work fine now  :)


If you wish to set or increase Heap size in apache tomcat on cpanel server (you can see the settings that are configurable if you issue “java -X” without the quotes), then create a file named /var/cpanel/tomcat.options. Add below entries in the file:


This would change the maximum Java heap size (Xmx) and the initial Java heap size (Xms) on startup.

After this has been done, Tomcat would need to be restarted from WHM:

Go to WHM » Restart Services » Servlet Server (Tomcat)

Once you restart tomcat it will show result as below:

Service Status
tomcat (jsvc.exec -user tomcat -cwd /usr/local/easy/share/easy-tomcat7 -pidfile /var/run/ -cp /usr/local/easy/bin/bootstrap.jar:/usr/local/easy/bin/tomcat-juli.jar:/usr/local/easy/share/java/commons-daemon.jar -Djava.endorsed.dirs=/usr/local/easy/share/easy-tomcat7/endorsed -outfile /var/log/easy-tomcat7/catalina.out -errfile /var/log/easy-tomcat7/catalina.err -verbose -Xmx2000M -Xms1000M org.apache.catalina.startup.Bootstrap start) running as 491 with PID 4437 (process table check method)

Startup Log
Adding in custom Tomcat option(s): -Xmx2000M
Adding in custom Tomcat option(s): -Xms1000M
Command '/usr/local/easy/bin/jsvc -user tomcat -cwd /usr/local/easy/share/easy-tomcat7 -pidfile /var/run/ -cp /usr/local/easy/bin/bootstrap.jar:/usr/local/easy/bin/tomcat-juli.jar:/usr/local/easy/share/java/commons-daemon.jar -Djava.endorsed.dirs=/usr/local/easy/share/easy-tomcat7/endorsed -outfile /var/log/easy-tomcat7/catalina.out -errfile /var/log/easy-tomcat7/catalina.err -verbose -Xmx2000M -Xms1000M org.apache.catalina.startup.Bootstrap start' returned: 0

tomcat started successfully.

That's all  :)

Errors and Solutions / Container already locked error - Openvz
« on: June 02, 2016, 04:01:33 PM »

If you receive this message when you try to stop/start the container:
[root@server ~]# vzctl start 302
Container already locked

To fix the issue delete the lock file of the container.
[root@server ~]# rm /vz/lock/302.lck
rm: remove regular file `/vz/lock/302.lck'? y

After that start the container:
[root@server ~]# vzctl start 302
Starting container...
Container is mounted
Container start in progress...

That's it  :)

Tomcat Java Hosting / Service unavailable error on website
« on: May 26, 2016, 04:04:11 PM »

One of our client was getting "Service Unavailable" error on website. Further checking it was generating below errors on the server.

INFO: validateJarFile(/home/username/public_html/WEB-INF/lib/selenium-server-standalone-2.52.0.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

There was compatibility issue of selenium-server-standalone-2.52.0.jar with the Tomcat server as it is a standalone server.

In order to fix issue don't use the standalone selenium jar, instead use the small non-standalone selenium jar and also use all the jars it depends on.

Download the full zip from HERE
After that Open the zip and copy selenium-java-2.53.0.jar in WEB-INF/lib folder and restart the Tomcat service.

That's it. Now your website should work fine  :)

Hi All,

You can set redirection for non-www URL to www URL in tomcat using UrlRewriteFilter. Below are the steps to set redirection:

1) Download UrlRewriteFilter to WEB-INF/lib directory of your website.

2) Go to WEB-INF/web.xml and add below code (near the top above any servlet mappings):


3) Create file urlrewrite.xml in WEB-INF and add below code:

              <name>Domain Name Check for</name>
                <condition name="host" operator="equal">^</condition>
               <to type="redirect">$1</to>

Note: Replace with original domain name.

4) Restart tomcat service on the server.

That's all. Your website should now redirect from non www URL to www URL.

Pages: [1]