Fix compilation magento errors - php

I want to enable magento compilation, but when I enable it I see follow errors:
Warning: include_once(.../includes/src/Mage_Core_functions.php) [function.include-once]: failed to open stream: No such file or directory in .../app/Mage.php on line 36
Warning: include_once() [function.include]: Failed opening '.../includes/src/Mage_Core_functions.php' for inclusion (include_path='/.../includes/src:.:/usr/share/php') in .../app/Mage.php on line 36
Warning: include_once(.../includes/src/Varien_Autoload.php) [function.include-once]: failed to open stream: No such file or directory in /.../app/Mage.php on line 37
Warning: include_once() [function.include]: Failed opening '.../includes/src/Varien_Autoload.php' for inclusion (include_path='.../includes/src:.:/usr/share/php') in .../app/Mage.php on line 37
Fatal error: Class 'Varien_Autoload' not found in .../app/Mage.php on line 53
Can anybody help me to fix them? I want compilation to be enabled. In Internet every answer on this question was disable the compilation. I want the compilation to be enabled. Just for information my magento version is 1.7.0.0

did you change access rights on /includes directory? Because, after the compilation, compiled source codes reside in /includes/src directory!
$ chmod o+w includes includes/config.php
# if its not work, do following
$ chmod -R 777 includes/
Modify :
To close the compilation mode, open the file includes/config.php and comment out the following line :
define(’COMPILER_INCLUDE_PATH’, dirname(__FILE__).DIRECTORY_SEPARATOR.’src’);
#define(’COMPILER_COLLECT_PATH’, dirname(__FILE__).DIRECTORY_SEPARATOR.’stat’);
to
#define(’COMPILER_INCLUDE_PATH’, dirname(__FILE__).DIRECTORY_SEPARATOR.’src’);
#define(’COMPILER_COLLECT_PATH’, dirname(__FILE__).DIRECTORY_SEPARATOR.’stat’);
If you want to enable compilation mode then go to admin section press the "RUN COMPILATION" button.
Summary :
I guess, you had forgetten to set directory permission before the compilation process therefore the compilation process has not been create compiled source code directory!
Remarks :
The compilation process might be headache. On each code modifications, you should compile again or contrary, you should disable to compile before the modification or extension installation. Some extensions are trouble with that. That is why so many people do not want to use in this option. Also, in v2.0 of Magento, the compilation process dropped, not available anymore!

Deactivate the compiler like Oğuz Çelikdemir recommended and then click on "Start compilation process" (or something like that. It's "Kompilierungsvorgang starten" in German). This initiates the compilation process rather then just "activating" it. This worked for me.

Related

Errors occurred during magento installation

I'm trying to install magento 1.x on my centos machine. After dowloading and extracting magento i faced this errrors
Warning: include_once(Mage/Core/functions.php): failed to open stream: No such file or directory in /home/xxxx/app/Mage.php on line 50
Warning: include_once(): Failed opening 'Mage/Core/functions.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/username/php') in /home/xxxx/app/Mage.php on line 50
Warning: include_once(Varien/Autoload.php): failed to open stream: No such file or directory in /home/xxxx/app/Mage.php on line 51
Warning: include_once(): Failed opening 'Varien/Autoload.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/username/php') in /home/xxxx/app/Mage.php on line 51
Fatal error: Class 'Varien_Autoload' not found in /xxxx/app/Mage.php on line 54
I tried to run php shell/compiler.php compile the the errors disappeared and the installation page appeared but without any next or back buttons.
How can i fix this issue?
Make sure on the new server , you have permissions to open and rewrite files. some mangento extensions require full permissions before installations.

Can't resolve include_path issues in CakePHP 2.x

I have a CakePHP install that won't resolve paths correctly using include_path.
Here's an example of an error from the PHP log.
PHP Warning: include(\website\cakephp\lib\Cake\Utility\Debugger.php): failed to open stream: No such file or directory in D:\website\cakephp\lib\Cake\Core\App.php on line 545
PHP Warning: include(): Failed opening '\website\cakephp\lib\Cake\Utility\Debugger.php' for inclusion (include_path='.;d:\website') in D:\website\cakephp\lib\Cake\Core\App.php on line 545
PHP Fatal error: Class 'Debugger' not found in D:\website\cakephp\lib\Cake\Error\ErrorHandler.php on line 223
My website is installed on drive D: but all calls to App::uses resolve to paths where the drive letter has been removed.
I've specified include_path = ".;D:\website" in the php.ini file.
Not sure what else can be done to resolve this issue.
EDIT:
If I change the input_path to .;D:\ then includes start working correctly.
I'm thinking there is something wrong with how my index.php configures paths.

warning errors in php

I am starting to work on a site that has been up for some time. It is producing the following error messages before I even got started:
Warning: main(includes/main_functions.php) [function.main]: failed to open stream: No such file or directory in \\boswinfs01\home\users\web\b748\ez.paphospro\includes\top.php on line 22
Warning: main() [function.include]: Failed opening 'includes/main_functions.php' for inclusion (include_path='.;c:\php\4\pear') in \\boswinfs01\home\users\web\b748\ez.paphospro\includes\top.php on line 22
Warning: main(includes/functions/functions_email.php) [function.main]: failed to open stream: No such file or directory in \\boswinfs01\home\users\web\b748\ez.paphospro\includes\top.php on line 23
Warning: main() [function.include]: Failed opening 'includes/functions/functions_email.php' for inclusion (include_path='.;c:\php\4\pear') in \\boswinfs01\home\users\web\b748\ez.paphospro\includes\top.php on line 23
Fatal error: Call to undefined function: get_includes_file() in \\boswinfs01\home\users\web\b748\ez.paphospro\includes\top.php on line 24
Could it be that the path in the includes\top.php file is incorrect? Or do I need to look for something else?
the top.php file includes the following code:
define('BASE_PATH' , '/--/--/--/--/--/--/'); (I took out the path in this example).
and on the lines 22, 23, 24 it has the following code:
`include("includes/main_functions.php");
include("includes/functions/functions_email.php");
include(get_includes_file("includes/config.php"));`
all the above files are on the server in those directories.
I really need some direction as to why the errors are there and what I can do to fix them.
Thanks for any and all help or suggestions.
The warning is caused by non existing script file or wrong file permissions.
I would recommend you to do some refactoring, replacing the include function with require_once. This way you'll get a fatal E_COMPILE_ERROR level error which is better than a misleading application.
Then you must define your application base path define('DOCROOT', realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR); and use it to reference all other application dependencies (e.g. require_once(DOCROOT.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR.'main_functions.php');

pear include_path data folder is no longer valid

I have a vps with centOS LAMP stack, and multiple domains/ips. A long time ago I had someone more familiar with SSH install pear on the vps, and I believe he configured it for a specific user/domain, which no longer exists, and now pear is throwing errors.
The old user/domain which no longer exists is "ljsspin" but when I look at my php.ini, the include path is:
include_path = ".:/usr/share/pear/:/usr/share/php:/var/www/ljsspin/data/pear/:"
I can execute pear commands in ssh, but I'm assuming the fact that the last portion of that include path no longer exists is the reason for the error.
So my question is how do I install the necessary /data/pear files into a new directory? I've tried upgrading pear, and that, too, produced an error (unable to unpackage a structure file).
Thanks for any guidance.
Exact error message I receive:
Warning: include() [function.include]: open_basedir restriction in effect. File(/usr/share/pear/Mail.php) is not within the allowed path(s): (/var/www/steve/data:.) in /var/www/steve/data/www/newdomain.com/admin/dashboard/includes/pdf.php on line 3
Warning: include(/usr/share/pear/Mail.php) [function.include]: failed to open stream: Operation not permitted in /var/www/steve/data/www/newdomain.com/admin/dashboard/includes/pdf.php on line 3
Warning: include() [function.include]: Failed opening 'Mail.php' for inclusion (include_path='.:/usr/share/pear/:/usr/share/php:/var/www/ljsspin/data/pear/:') in /var/www/steve/data/www/newdomain.com/admin/dashboard/includes/pdf.php on line 3
The open_basedir restriction in effect error message means that you've set a value for the open_basedir PHP directive so scripts are not allowed to read files from outside a given set of directories, which in your case are these:
/var/www/steve/data
.
Since PEAR packages are installed in some other directory:
/usr/share/pear/
... PHP prevents scripts from reading them, as it's been instructed to do.
If you intend to allow access to /usr/share/pear/, you'll obviously have to broaden the restriction.

Pear installed, but php includes provides errors

I just leased a dedicated windows server with Plesk 10.4 installed. I assumed that php, etc would all be configured and that I could prot my sites over with no isses...
Turns out the default image didn't have pear installed...I believe i need pear so include statements work in php...so I used go-pear.bat to install it...
However, I'm still getting an error when including (you can follow the path to see the file exists)
Warning: include(Connections/SamConnection.php) [function.include]: failed to open stream: Operation not permitted in C:\Inetpub\vhosts\80stunes.com\httpdocs\index.php on line 3
Warning: include() [function.include]: Failed opening 'Connections/SamConnection.php' for inclusion (include_path='.;C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\PEAR;C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5;./includes;./pear') in C:\Inetpub\vhosts\80stunes.com\httpdocs\index.php on line 3
Any ideas on what I have done wrong? I can run pear commands from a command prompt when accessing my pleskphp5 directory
Sounds like you may have open_basedir enabled.

Categories