fatal error Varien_Autoload not found - magento

Goodday everyone,
I installed magento with the sample data I refreshed the page and everything seemed to work. My complete shop was filled with sample data. A couple of minutes after I refreshed again and since then I keep getting this error:
PHP Fatal error: Class 'Varien_Autoload' not found in /var/www/vhosts/shop.cyberned.com/httpdocs/app/Mage.php on line 53
I double checked if Varien_Autoload exists and it is there in lib/Varien/Autoload.php
It looks like that file is not included for some reason but I would have no idea how to get that fixed. So my question is: how do I get this fixed?

This error occurs because of the lib folder is not in the include_path. This may happen only if the COMPILER_INCLUDE_PATH constant is defined. Most likely this constant is defined in the includes/config.php file.

I have the same problem, I did following steps and now it is working :)
Check Compilation mode is disabled or not in include/config.php file. if not then edit and make sure these two lines should be same as written below :-
#define('COMPILER_INCLUDE_PATH',dirname(__FILE__).DIRECTORY_SEPARATOR.'src');
#define('COMPILER_COLLECT_PATH',dirname(__FILE__).DIRECTORY_SEPARATOR.'stat');
Flush magento cache Storage
sudo rm -rf var/cache/*
Set Correct Permission
sudo chmod -R 755 *
Restart the Webserver (apache/nginx)
Now Verify.

Check out the permission problem, Mage.php may not have the right to load the class 'Varien_Autoload'.
http://www.magentocommerce.com/wiki/groups/227/resetting_file_permissions

Related

Joomla "Fatal error: Cannot redeclare jblogerror() in on line 0"

Here is a weird problem i'm facing; after updating Joomla to the latest version, website failed to up load but, as i've made a backup manually from these folders:
administrator
bin
cli
components
includes
layouts
libraries
modules
plugins
yt-assets
and all the root files, after restoring the backup still the website is not loading and just says
"Fatal error: Cannot redeclare jblogerror() in on line 0" !
Any suggestion? Thank you.
Apparently, the version of jBlog you are using is loading its attempting to load its own classes twice.
Let's assume the jBlog developers already fixed it and you carelessly ignored the warning to ensure all your extensions are compatible before updating.
Are you able to access administrator? Simply go there and upgrade jBlog including any modules.
Else, the issue lies within a plugin. In order to access the administrator and perform the update, you will need to manually disable the offending plugin.
A simple way is to rename its folder: start from plugins/system then plugins/content hopefully you'll have spotted it by then. Look into the subfolders of each and spot any that may be relevant to jBlog (or grep through the folder to locate the specific string)
If you have console access, simply run
# grep -rl jblogerror plugins/system
and you should see all the files that include such string, just rename their main plugin folder. But you could also do all this through ftp and guessing.

How could I do a massive install of a PrestaShop module?

I have a problem, I have to do a massive install of a custom PrestaShop module on 1500 e-commerce, but I don't know if this is possible, I was thinking to include a file called install.php and run through a.sh, this file may contain the next.
For example:
<?php
include "meli.php";
$meli = new Meli();
$meli->install();
?>
I called this file and initially, nothing happened so I check the possible reason and was:
if (!defined('_PS_VERSION_'))
exit;
So I commented this and run it again but this show me this error:
Fatal error: Class 'Module' not found in /home/dev2al5/public_html/modules/meli/meli.php on line 7
Does someone know how I can do this process?
Indeed I would do 3 things in the SH script:
Copy of the modules files in each site in the modules folder
Copy of a sql file containing the instructions to be executed
Calling a URL present in each module that would execute the SQL and then delete the SQL file in question
Regards

I can't get new modules to load in metasploit

I have been trying to load a new module in MS. I followed the instructions and done a git clone [address of files]. I then copied the new files into /root/.msf4/modules/exploits/windows/smb and into /usr/share/metasploit-framework/modules/windows/smb and issued reload_all and restarted msfconsole but still no matter what way i try it it still says:
msf > use exploits/windows/smb/eternalblue_doublepulsar
[-] Failed to load module: exploits/windows/smb/eternalblue_doublepulsar
msf >
i tried every combo including:
use exploit/windows/smb/eternalblue_doublepulsar
use exploits/windows/smb/eternalblue_doublepulsar
use exploit/windows/smb/eternalblue_doublepulsar.rb
use exploits/windows/smb/eternalblue_doublepulsar.rb
and also the same with other downloadable modules
i double checked the file path, i tried:
chmod 644 eternalblue_doublepulsar.rb
to make the perms the same as the other modules in the same folder
which work btw
any help would be much appreciated
Thank you
Damian Moore
Did u clone the exploit from https://github.com/ElevenPaths/Eternalblue-Doublepulsar-Metasploit? a way to debug, choose an exploit which already exists in the folder(such as ms08_067_netapi.rb),change the name to eternalblue_doublepulsar,and reload_all,run it and see what will be happened.

Magento cache_dir is not writable and throws an error

I am new to Mangento. Any operation i do like navigation in the admin panel i am getting the following error.
Can someone tell me where can i find the cache_dir directory in a Magento Installation ?
Also it was working perfectly fine until 3 days. what could have made this error ?
http://pastebin.com/jHcD82wv
The cache folder is by default here:
/var/www/html/var/cache
or here:
/var/www/html/<Magento installation dir>/var/cache
By the way, if you're not sure how to find a folder, you can always go to the root directory and do:
ls -R | grep -i cache
Update:
The name of the variable is cache_dir. It is taken from: app/code/core/Mage/Core/Model/Config/Options.php:
$this->_data['cache_dir'] = $this->_data['var_dir'].DS.'cache';

Call to undefined function mysql_connect [duplicate]

This question already has answers here:
Fatal error: Call to undefined function mysql_connect() in C:\Apache\htdocs\test.php on line 2
(2 answers)
Closed 3 months ago.
I just installed PHP and Apache on my home PC. When I try to call function mysql_connect I get:
fatal error: call to undefined function mysql_connect.
I have loaded php.ini where I have uncommented lines extension=php_mysql.dll and
extension=php_mysqli.dll and changed extension directory to extension_dir = "C:\php\ext" - which is the directory where files php_mysql.dll and php_mysqli.dll are. How can I fix this problem?
Output of phpinfo():
http://jsfiddle.net/MMTwA/
After looking at your phpinfo() output, it appears the mysql extensions are not being loaded. I suspect you might be editing the wrong php.ini file (there might be multiple copies). Make sure you are editing the php file at C:\php\php.ini (also check to make sure there is no second copy in C:\Windows).
Also, you should check your Apache logs for errors (should be in the \logs\ directory in your Apache install.
If you haven't read the below, I would take a look at the comments section, because it seems like a lot of people experience quirks with setting this up. A few commenters offer solutions they used to get it working.
http://php.net/manual/en/install.windows.extensions.php
Another common solution seems to be to copy libmysql.dll and php_mysql.dll from c:\PHP to C:\Windows\System32.
Background about my (similar) problem:
I was asked to fix a PHP project, which made use of short tags. My WAMP server's PHP.ini had short_open_tag = off.
In order to run the project for the first time, I modified this setting to short_open_tag = off.
PROBLEM Surfaced:
Immediately after this change, all my mysql_connect() calls failed. It threw an error
fatal error: call to undefined function mysql_connect.
Solution:
Simply set short_open_tag = off.
My PC is running Windows 7 (Apache 2.2 & PHP 5.2.17 & MySQL 5.0.51a), the syntax in the file "httpd.conf" (C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\httpd.conf) was sensitive to slashes.
You can check if "php.ini" is read from the right directory. Just type in your browser "localhost/index.php". The code of index.php is the following:
<?php
echo phpinfo();
?>
There is the row (not far from the top) called "Loaded Configuration File". So, if there is nothing added, then the problem could be that your "php.ini" is not read, even you uncommented (extension=php_mysql.dll and extension=php_mysqli.dll). So, in order to make it work I did the following step. I needed to change from
PHPIniDir 'c:\PHP\'
to
PHPIniDir 'c:\PHP'
Pay the attention that the last slash disturbed everything!
Now the row "Loaded Configuration File" gets "C:\PHP\php.ini" after refreshing "localhost/index.php" (before I restarted Apache2.2) as well as mysql block is there. MySQL and PHP are working together!
You have probably forgotten to restart apache/wamp/xamp/whatever webserver you use, you need to do that in order to make it work
Check your php.ini, I'm using Apache2.2 + php 5.3. and I had the same problem and after modify the php.ini in order to set the libraries directory of PHP, it worked correctly. The problem is the default extension_dir configuration value.
The default (and WRONG) value for my work enviroment is
; extension_dir="ext"
without any full path and commented with a semicolon.
There are two solution that worked fine for me.
1.- Including this line at php.ini file
extension_dir="X:/[PathToYourPHPDirectory]/ext
Where X: is your drive letter instalation (normally C: or D: )
2.- You can try to simply uncomment, deleting semicolon. Include the next line at php.ini file
extension_dir="ext"
Both ways worked fine for me but choose yours. Don't forget restart Apache before try again.
I hope this help you.
Hi I got this error because I left out the ampersand (&) in
; php.ini
error_reporting = E_ALL & ~E_DEPRECATED
Be sure you edited php.ini in /php folder, I lost all day to detect error and finally I found I edited php.ini in wrong location.
After change our php.ini, make sure to restart Apache web server.
Just for future reference, copying all these extension files to Windows/System or Windows/System32 is unnecessary.
All that is required is a copy of the php.ini file you edit in the PHP dir to copied to the root Windows dir.
phpinfo will clearly explain the below:
Configuration File (php.ini) Path C:\Windows
Logical sense will explain that php wants to load a config located in the Windows dir. :-)
One time I had a problem while using Off instead of off. And also check the pads one more time... The path has to be exact. Also add the following line to your environmental variable.
C:\your-apache-path\bin; C:\your-php-path\bin;C:\your-mysql-path\bin
If you are in Windows, right click My Computer, select properties, and navigate to the Advanced tab... (is Windows 7). Click on Advanced system settings first then select the Advanced tab and then Environmental variables. Select PATH and click on Edit. Make a copy of the string in a .txt file for back up (it might be empty)--- set your environmental variables... Log out and log back in.
Since mysql_connect This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used.
by default xampp does not load it automatically
in your php.ini file you should uncomment
;; extension=php_mysql.dll
to
extension=php_mysql.dll
Then restart your apache you should be fine
This same problem drove me nuts (Windows 10, Apache 2.4, MySql 5.7). For some reason (likely PATH related), the .dlls would not load after uncommenting the correct exension dlls and extension_dir = "ext" in php.ini. After trying numerous things, I simply changed "ext" to use the full directory path. For example. extension_dir = "c:/phpinstall/ext" and it worked.
I think that you should use mysqli_connect instead of mysql_connect

Resources