Help File

Problems and solutions

Introduction

You can find solutions in this help file for some common problems that you can see on some servers.

.htaccess

.htaccess is a directory-level configuration file supported by the Apache web server. It is used to alter web server configuration (enable or disable additional features) for the specific account without changing global server settings. You can find this file in main directory of script files. You can add some new codes to redirect your URLs to HTTPS or www.

Redirecting to HTTPS

If you want to redirect your URLs to HTTPS, you can add a redirect to your .htaccess.

Option 1:


RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond $1 !^(index.php|assets|images|js|css|uploads|favicon.png|install|sitemap.xml|robots.txt|update.php)
RewriteCond %(REQUEST_FILENAME) !-f
RewriteCond %(REQUEST_FILENAME) !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
        

Option 2:


RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
RewriteCond $1 !^(index.php|assets|images|js|css|uploads|favicon.png|install|sitemap.xml|robots.txt|update.php)
RewriteCond %(REQUEST_FILENAME) !-f
RewriteCond %(REQUEST_FILENAME) !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
        

Redirecting to www

If you want to redirect your non-www URLs to www, you can add a redirect to your .htaccess:


RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond $1 !^(index.php|assets|images|js|css|uploads|favicon.png|install|sitemap.xml|robots.txt|update.php)
RewriteCond %(REQUEST_FILENAME) !-f
RewriteCond %(REQUEST_FILENAME) !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
        

Redirecting to non-www

If you want to redirect your www URLs to non-www, you can add a redirect to your .htaccess:


RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteCond $1 !^(index.php|assets|images|js|css|uploads|favicon.png|install|sitemap.xml|robots.txt|update.php)
RewriteCond %(REQUEST_FILENAME) !-f
RewriteCond %(REQUEST_FILENAME) !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
        

Redirecting to HTTPS and www

If you want to redirect your URLs to HTTPS and www, you can add a redirect to your .htaccess:


RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond $1 !^(index.php|assets|images|js|css|uploads|favicon.png|install|sitemap.xml|robots.txt|update.php)
RewriteCond %(REQUEST_FILENAME) !-f
RewriteCond %(REQUEST_FILENAME) !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
        

Redirecting to HTTPS and non-www

If you want to redirect your URLs to HTTPS and non-www, you can add a redirect to your .htaccess:


RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteCond $1 !^(index.php|assets|images|js|css|uploads|favicon.png|install|sitemap.xml|robots.txt|update.php)
RewriteCond %(REQUEST_FILENAME) !-f
RewriteCond %(REQUEST_FILENAME) !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
        

General PHP Errors

You can find general PHP errors and solutions in this section.

PHP Version Error

Fatal error: Can't use function return value in write context in /home/rozenseccd/www/application/controllers/Home_controller.php on line 50

A PHP Error was encountered

Severity: Compile Error

Message: Can't use function return value in write context

Filename: controllers/Home_controller.php

Line Number: 50

Backtrace:

Solution:

In order for our script to work properly, your PHP version must be 5.6 or a higher version. If you see this error, please go to PHP settings in your server and change your PHP version.

Unknown Hashing Algorithm

A PHP Error was encountered

Severity: Warning

Message: hash(): Unknown hashing algorithm: fnv1a64

Filename: helpers/url_helper.php

Line Number: 392

Backtrace:

Solution:

fnv1a64 hashing algorithm exists in PHP 5.6 and higher versions. If you see this error, please go to PHP settings in your server and change your PHP version.

Cannot Modify Header Error

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /www/htdocs/w01153df/v9/application/language/german/back_end_lang.php:1)

Filename: helpers/url_helper.php

Line Number: 564

Backtrace:

Solution:

You can see this problem if you edit your script codes. When you edit your codes, you should use a PHP editor otherwise you may break the encoding structure of PHP files. To solve this problem, please take back your custom edits if you edited script files. Or download the script from CodeCanyon and update your edited files.

INTL_IDNA_VARIANT_2003 is Deprecated Error

A PHP Error was encountered

Severity: 8192

Message: idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated

Filename: src/IDN.php

Line Number: 45

Solution:

If 'INTL_IDNA_VARIANT_UTS46' variable is not defined in your PHP settings, you can see this error. To fix this error, you can download following file and replace it with 'application/third_party/domain-parser/layershifter/tld-extract/src/IDN.php' file.

IDN.php

Database Connection Errors

Access Denied Error

A PHP Error was encountered

Severity: Warning

Message: mysqli::real_connect(): (HY000/1044): Access denied for user ''@'localhost' to database 'db'

Filename: mysqli/mysqli_driver.php

Line Number: 203

Backtrace:

File: /Applications/XAMPP/xamppfiles/htdocs/modesy-v1.3.2/application/config/routes.php
Line: 257
Function: DB

File: /Applications/XAMPP/xamppfiles/htdocs/modesy-v1.3.2/index.php
Line: 315
Function: require_once

Solution:

This error is a database connection error. If you see this error, open 'application/config/database.php' file and check your database credentials.


'hostname' => 'localhost',
'username' => '',
'password' => '',
'database' => '',
        

CI_Controller Not Found Error

Fatal error: Class 'CI_Controller' not found in /Applications/XAMPP/xamppfiles/htdocs/modesy-v1.3.2/system/core/CodeIgniter.php on line 369

A PHP Error was encountered

Severity: Error

Message: Class 'CI_Controller' not found

Filename: core/CodeIgniter.php

Line Number: 369

Backtrace:

Solution:

This error is a database connection error. If you see this error, open 'application/config/database.php' file and check your database credentials.


'hostname' => 'localhost',
'username' => '',
'password' => '',
'database' => '',
        

Timezone Errors

Invalid Date Error

A PHP Error was encountered

Severity: Warning

Message: date(): Invalid date.timezone value 'x/x', we selected the timezone 'UTC' for now.

Filename: helpers/custom_helpers.php

Line Number: 530

Solution:

This error is a timezone error. If you see this error, open 'application/config/config.php' file and set your timezone value. You should change 'time_reference' value in this file. Example:


$config['time_reference'] = 'America/New_York';
    
If you are using Modesy, you should change your timezone in your Admin panel from Settings section.

You can see PHP timezones in this URL: https://www.php.net/manual/en/timezones.php

Invalid Timezone Error

A PHP Error was encountered

Severity: Notice

Message: date_default_timezone_set(): Timezone ID '..' is invalid

Filename: core/Core_Controller.php

Line Number: 15

Backtrace:

Solution:

This error is a timezone error. If you see this error, open 'application/config/config.php' file and set your timezone value. You should change 'time_reference' value in this file. Example:


$config['time_reference'] = 'America/New_York';
    
If you are using Modesy, you should change your timezone in your Admin panel from Settings section.

Email Errors

If you have a problem with sending mail, please read the documentation. There are 3 different email options in our scripts. If you see a problem with 'SMTP' protocol option, please select 'Mail' protocol option with CodeIgniter email option. Some email options may not work on some servers, so you should try all email options for your server. You can find documentation files in script files.

Image Upload Errors

If you have a problem with uploading images, there could be some problems in your server. Please make sure that these settings are made on your server:

1. 'uploads' folder and all folders in this folder should be writable. File permissions should be 0755.

2. You should increase some limits in your server. These are recommended minimum values:

upload_max_filesize 32M
post_max_size 32M
memory_limit 256M

3. Gd and Fileinfo PHP extensions should be enabled in your server.

Module Errors

These errors are not related to our script codes. If you see one of these errors, you should contact your hosting service. These errors are generally caused by incorrect configurations in the php.ini file.

Error 1

A PHP Error was encountered

Severity: Core Warning

Message: PHP Startup: SourceGuardian: Unable to initialize module Module compiled with module API=20131226 PHP compiled with module API=20151012 These options need to match

Filename: Unknown

Line Number: 0

Backtrace:

Error 2

A PHP Error was encountered

Severity: Core Warning

Message: Module 'curl' already loaded

Filename: Unknown

Line Number: 0

Backtrace:





If 'INTL_IDNA_VARIANT_UTS46' variable is not defined in your PHP settings, you can see this error. To fix this error, you can download following file and replace it with 'application/third_party/domain-parser/layershifter/tld-extract/src/IDN.php' file.

IDN.php

Modesy Shipping

For Modesy, you can download this update and replace files if you want to make the shipping optional:

Update.zip