I built a small website using Joomla 3.4.0./ Wampserver 2.4 on Windows 8.1 Pro.
Now I've upgraded the computer to Windows 10 Pro and Wamp 3.1.7 (64 bit). I've rebuilt the website with latest version of Joomla 3.9.3 from scratch, and its working fine EXCEPT all those custom modules which access the user object. I havent changed anything yet. I'm getting error as below:
( ! ) Warning: require_once(C:/wamp64/www/includes/defines.php): failed to open stream: No such file or directory in C:\wamp64\www\clib\custom\userdnld.php on line 7
Call Stack # Time Memory Function Location 1 0.0007 402200 {main}( ) ...\userdnld.php:0 ( ! ) Fatal error: require_once(): Failed opening required 'C:/wamp64/www/includes/defines.php' (include_path='.;C:\php\pear') in C:\wamp64\www\clib\custom\userdnld.php on line 7
Call Stack # Time Memory Function Location 1 0.0007 402200 {main}( ) ...\userdnld.php:0
My custom module begins with code as under:
<?php
$mf1="";
define( '_JEXEC', 1 );
define( 'DS', DIRECTORY_SEPARATOR );
define( 'JPATH_BASE', $_SERVER[ 'DOCUMENT_ROOT' ] );
require_once( JPATH_BASE . DS . 'includes' . DS . 'defines.php' );
require_once( JPATH_BASE . DS . 'includes' . DS . 'framework.php' );
require_once( JPATH_BASE . DS . 'libraries' . DS . 'joomla' . DS . 'factory.php' );
$mf1 = JFactory::getApplication('site');
date_default_timezone_set("Asia/Calcutta");
$user = JFactory::getUser();
$uname=$user->name;
$uid=$user->id;
$date= JFactory::getDate();
?>
When I'm accessing from localhost, it works as expected, but not when I access from any machine on LAN.