I create a simple class from a different file and include it
to a page that used to create an object of that class.
Everything works fine, the problems occurs is when I update
the class, I need to manually access the class from my browser
then the page that I create the object will get the latest modified class
or it will receive Error.
below is the page code I use to create an object of the class
<?php
function __autoload($class_name) {
require '/classes/'.$class_name . '.php';
}
$rain = new myClass;
echo $rain->TestMethod(12345,123451);
?>
If I update my class, and without accessing it manually from my browser I will receive this error from my Apache2.
PHP Fatal error: require(): Failed opening required '/classes/myClass.php' (include_path='.:/usr/share/php:/usr/share/pear')
Check if you are using a PHP op cache, or any Apache PHP cache or something that makes your php files not been readead from disk when you change them.
I usually have many problems with shared servers because these modules.
(i see the
/is the root folder. It’s a common mistake if your classes are not in the root folder of your webserver.)