Showing posts with label php. Show all posts
Showing posts with label php. Show all posts
This requires Apache Mysql stack - here making use of bitnami wamp stack 

  •  Copy webzash-v2.8.zip in the htdoc folder
C:\Bitnami\wampstack-7.2.22-0\apache2\htdocs

  • Extract the zip file which will have the folder name cakephp-2.10.14
    Rename it as webzashtest2(its your prerogative)
  • In the web browser access the locally hosted site  -
    http://127.0.0.1:81/webzashtest2
    
    which will return the following error/page
\app\Plugin\Webzash\Config\bootstrap.php (line 337)

'Missing master sqlite database file. Please check your setup.'

Webzash
 Errors
Missing Database Connection

Error: A Database connection using "Sqlite" was missing or unable to connect.
The database server returned this error: Selected driver is not enabled

Error: Sqlite driver is NOT enabled

Notice: If you want to customize this error message, create app\View\Errors\missing_connection.ctp



  • Here master scheme database is not present/configured in the mysql database.
Log in phpmyadmin page


Create database webzashtest2db

Import MasterSchema.MySQL.sql to populate webzashtest2db
MasterSchema.MySQL.sql is present in
C:\Bitnami\wampstack-7.2.22-0\apache2\htdocs\webzashtest2\app\Plugin\Webzash\Config






Edit MasterConfig.php
C:\Bitnami\wampstack-7.2.22-0\apache2\htdocs\webzashtest2\app\Plugin\Webzash\Config
and database.php
C:\Bitnami\wampstack-7.2.22-0\apache2\htdocs\webzashtest2\app\Config
with
$ diff -uNr MasterConfig.php ../../../../../webzashtest2/app/Plugin/Webzash/Config/MasterConfig.php > patchfile
--- MasterConfig.php 2019-01-15 18:22:28.000000000 +1100
+++ ../../../../../webzashtest2/app/Plugin/Webzash/Config/MasterConfig.php 2019-10-14 21:08:17.892756900 +1100
@@ -55,8 +55,13 @@
  * $wz['settings'] = ''; // Optional parameter
  */
 
-$wz['datasource'] = 'Database/Sqlite';
-$wz['database'] = $root_path . 'Database/' . 'webzash.sqlite';
+$wz['datasource'] = 'Database/Mysql';
+/*$wz['database'] = $root_path . 'Database/' . 'webzash.sqlite';*/
+$wz['database'] = 'webzashtest2db';
+$wz['host'] = '127.0.0.1';
+$wz['port'] = '3307';
+$wz['login'] = 'root';
+$wz['password'] = 'r12348';
 $wz['prefix'] = '';
 $wz['encoding'] = 'utf8';
 $wz['persistent'] = false;

and
$ diff -uNr database.php ../../../webzashtest2/app/Config/database.php > patchfile
--- database.php 2017-07-23 05:06:53.000000000 +1000
+++ ../../../webzashtest2/app/Config/database.php 2019-10-14 21:06:18.293559900 +1100
@@ -69,10 +69,11 @@
  public $default = array(
   'datasource' => 'Database/Mysql',
   'persistent' => false,
-  'host' => 'localhost',
-  'login' => 'user',
-  'password' => 'password',
-  'database' => 'database_name',
+  'host' => '127.0.0.1',
+  'port' => '3307',
+  'login' => 'root',
+  'password' => 'r12348',
+  'database' => 'webzashtest2db',
   'prefix' => '',
   //'encoding' => 'utf8',
  );

This will lead to the login page


Hosting Co. Upgrade and causality

In the shared hosting environment the hosting providers upgrade the platform/features/environment which will cause certain unexpected behavior(s) as the screen-shot(s) which showed that certain function were deprecated due to upgrading of php to what the hosting company found fit.

a) In the home page the following msg was displayed

"Function ereg() is deprecated in /home/gnum****/public_html/includes/file.inc on line 895"

In the file file.inc the ereg is replaced with preg_match
- elseif ($depth >= $min_depth && ereg($mask, $file)) {
+ elseif ($depth >= $min_depth && preg_match("/$mask/", $file)) {





b) In the qchronicle page a warning msg similar to
"Warning: strtotime()[fuction.strtotime]: It is not safe to rely on the system's timezone settings. You are "required" to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/London' for 'BST/1.0/DST' instead in /home/gnum****/public_html/sites/all/modules/views/modules/node/views_handler_argument_dates_various.inc on line 66"



The following warning regarding date/time was displayed which was resolved by appending the
date_default_timezone_set('Europe/London');
at the top of bootstrap.inc file

<u-09-08-2012>
when edit tab is selected in the drupal's blog section, following msg is displayed
: Function eregi_replace() is deprecated in /home/gnumeno/public_html/sites/all/themes/basic/template.php on line 46.
- $body_classes[] = 'tax-' . eregi_replace('[^a-z0-9]', '-', $term->name);
+ $body_classes[] = 'tax-' . preg_replace('/[^a-z0-9]/', '-', $term->name);
 </u-09-08-2012>
top