Bug #53215
closedRename symlink of typo3_src results in fatal error
0%
Description
Hello Core-Team,
in all previous TYPO3-Installations you can change typo3_src to another location without any problems. But here in current GIT-Version (30.10.2013) I get following fatal error when doing so:
Warning: require(/kunden/removedPath/typo3_src-6.2.0-2013-10-22/typo3/sysext/core/Resources/PHP/TYPO3.Flow/Classes/TYPO3/Flow/Package/PackageManager.php) [function.require]: failed to open stream: No such file or directory in /kunden/removedPath/typo3temp/Cache/Code/cache_classes/typo3_flow_package_packagemanager.php on line 1
Fatal error: require() [function.require]: Failed opening required '/kunden/removedPath/typo3_src-6.2.0-2013-10-22/typo3/sysext/core/Resources/PHP/TYPO3.Flow/Classes/TYPO3/Flow/Package/PackageManager.php' (include_path='/www/removedPath/typo3/contrib/pear/:.:/usr/local/lib/php') in /kunden/removedPath/typo3temp/Cache/Code/cache_classes/typo3_flow_package_packagemanager.php on line 1
As you can see some files in cache_classes refer to an old path. The new path is: typo3_src-6.2.0-2013-10-30
Please create these paths with symlink and not with path behind symlink.
Stefan
Updated by Stefan Froemken about 11 years ago
I can't access Installtool. I thought Installtool can run self-sufficient?! So there is no possibility to clear the cache.
The error appears in cache_classes. So I have make: rm -rf ./cache_classes
Now following error appears:
Warning: require_once(/kunden/removedPath/typo3_src-6.2.0-2013-10-22/typo3/sysext/core/Classes/Package.php) [function.require-once]: failed to open stream: No such file or directory in /kunden/removedPath/typo3_src-6.2.0-2013-10-30/typo3/sysext/core/Classes/Package/PackageManager.php on line 223
Fatal error: require_once() [function.require]: Failed opening required '/kunden/removedPath/typo3_src-6.2.0-2013-10-22/typo3/sysext/core/Classes/Package.php' (include_path='/www/removedPath/typo3/contrib/pear/:.:/usr/local/lib/php') in /kunden/removedPath/typo3_src-6.2.0-2013-10-30/typo3/sysext/core/Classes/Package/PackageManager.php on line 223
Updated by Stefan Froemken about 11 years ago
OK...after rm -rf ./cache_core too, Installtool works again.
But please: Try to work with correct paths.
Updated by Tomita Militaru about 11 years ago
After any upgrade of the TYPO3 core (aka change typo3_src) you need to clear the cache.
Updated by Wouter Wolters about 11 years ago
Then I suggest to do a clear all cache (whichh is available in Install Tool) after the switch of the symlink.
Updated by Stefan Froemken about 11 years ago
Hello,
as I told you, I have to clear the cache manually on filesystem first, before I can access the installtool. There is no possibility to access Installtool after changing the symlink.
The second question is: Why are you working with resolved path of symlink (typo3_src-6.2.0-beta) and not with symlink (typo3_src) itself?
Stefan
Updated by Jörg Wagner over 10 years ago
This problem is alive and kicking in 6.2.3.
It has driven us nuts for about one week.
On a hosting webspace with no visible error reporting and no access to the PHP error log, FE and BE simply returned blank white pages with no clue what was going wrong.
Now we found out that this was due to the cache files that were copied with the project and that tried to access absolute paths of the local development system.
Most definitely Stefan is right with his complaints:
When a devel system is copied to a production system and the resulting installation locks you out and leaves you completely helpless, there is a rational for an improvement of the code logic.
Only after finding and reading this report we realized that we had to clear /typo3temp/Cache/ to get the system working again.
Updated by Patrick Crausaz about 10 years ago
I got the same error while installing 6.2.5
What I did:
1. Downloaded the current source and unzip.
2. Created Symlink index.php and typo3 to the target "typo3_src-6.2.5
3. Created File "FIRST_INSTALL" in Root
4. Opened the website in the Browser
5. Here it shows up a warning: Symlink to wrong target
6. Move the typo3_src-6.2.5 directory to "typo3_src" and changing the symlink targets to typo3_src instead of typo3_src-6.2.5
7. Reload the website in the browser ->> ERROR: require_once uses old symlink target
- There is no typo3temp/Cache created at this point. SO there aren't any cached files that could be deleted.
- There is no Install-Tool at this point of installation
- Tried to clear Cookies, Session Cookies. Browser Cache. Nothing worked
Error occures in "typo3/sysext/core/Classes/Core/ClassLoader.php" on Line 182
require_once $classLoadingInformation0;
Updated by Markus Klein about 10 years ago
The correct structure should be:
- typo3_src-6.2.5 folder as downloaded
- typo3_src symlink to typo3_src-6.2.5
- typo3 symlink to typo3_src/typo3
- index.php symlink to typo3_src/index.php
Updated by Patrick Crausaz about 10 years ago
@ Markus Klein
Yes, thats correct. But thats no justification that the system breaks when the symlink were different. Not everybody will use the links that way, only because it's suggested to do so.
And the error still occures, also with this configuration.
I'm not quite sure if this is a TYPO3 issue or a PHP issue. When I debug the given path that is used for require_once, all paths seems to be correct.
Or related to Apache? I also found some PHP related issues while googling about that. Keywords: "Changing symlinks require_one"
Updated by Markus Klein about 10 years ago
@Patrick Broens: Did you think about opcode caches? Maybe you're running opcache, then you need to clear that cache too if you change the symlinks. That's a PHP issue.
Updated by Patrick Crausaz about 10 years ago
@Markus
I just tried to change symlinks in one project and cleared the opcode cache with the clear button within the Install Tool.
The website is running yet. It took about 5 minutes and probably 60 refreshes of the page in the browser.
what I did:
1. changed symlinks index.php and typo3 to a new target.
2. same php fatal error appears: require_once failed to open steam... in ClassLoader.php // Frontend and Backend and Install Tool; same error
3. Refresh the website // same error, but the file that should be loaded has changed (file to be loaded in require_once(...file...))
4. Refreshed the page (of the install tool) several times, PHP throws always the same error but always with another Class to load in the ClassLoader.
5. I assumed that the ClassLoader had to pass though all the classes/files by refreshing the page. Finally after about 20 refreshes the Install Tool appeared and it was possible to access the Clear Cache button.
6. Cleared Cache and opcode cache within the Install Tool.
7. Again refreshing the Install Tool and the Frontend about 50 times. (you can see that it's working as long as the Error always changes)
- sometimes the page loades, and one refresh later another error comes up. Just clicking trough the page for 5 minutes until all errors are gone.
BE, FE and Install Tool now working.
Would it be helpful, if we did a try and catch on the require_once function in that ClassLoader.php ? When the file cannot be loaded, try the next.
Try to open file, when it's not working, try the next. And when all files were passes through, there should be an exception thrown.
That way you don't have to refresh the page a hundred times and the user has a clue about what is happening when he gets the exception.
Updated by Markus Klein about 10 years ago
Well, you have to clear the opcode cache on the command line (or restart the webserver) once you change the symlinks of course the Install Tool won't work either.
Anything you add to the ClassLoader slows down TYPO3 extremely, hence it should be optimized for the common case, which a symlink change clearly is not.
Updated by Patrick Crausaz about 10 years ago
Agreed.
So at least it would be nice to have an official documentation / tutorial in the wiki for that case. Because it wasn't easy to figure out what the actual problem was and I see there are a few guys with that issue.
Updated by Markus Klein about 10 years ago
Maybe you can add this information there: http://wiki.typo3.org/Opcode_Cache
Updated by Urs Braem about 10 years ago
I've been experiencing similar behaviour upon upgrading from TYPO3 6.2.5 to 6.2.6
Line 182 in sysext/core/Classes/Core/ClassLoader.php was requiring the old version of the core (6.2.5) which resulted in a php error.
Warning: require_once(/home/username/typo3_src-6.2.5/typo3/sysext/core/Resources/PHP/TYPO3.Flow/Classes/TYPO3/Flow/Package/PackageManager.php): failed to open stream: No such file or directory in /home/username/typo3_src-6.2.6/typo3/sysext/core/Classes/Core/ClassLoader.php on line 182 Fatal error: require_once(): Failed opening required '/home/username/typo3_src-6.2.5/typo3/sysext/core/Resources/PHP/TYPO3.Flow/Classes/TYPO3/Flow/Package/PackageManager.php' (include_path='/home/username/public_html/upgrade/typo3/contrib/pear/:.:/opt/alt/php55/usr/share/pear:/opt/alt/php55/usr/share/php') in /home/username/typo3_src-6.2.6/typo3/sysext/core/Classes/Core/ClassLoader.php on line 182
I cleared the cache manually (rm -r typo3temp/*) and also had to remove and recreate the symlink to the core. Then I could log in again.
BUT a day later, the error was there again. I cleared the cache again, now also in the install tool. This helped.
Above, Tomita Militaru says:
After any upgrade of the TYPO3 core (aka change typo3_src) you need to clear the cache.
Can that be? In 4.5, I've never needed to do this for minor upDATEs. And we're not talking about major upgrades here.
Updated by Peter Buzanits about 10 years ago
I ran into the same issue while migrating a 6.2.6 site to a different server. The old paths are in the cache and the cache cannot be deleted because install tool and backend are not reachable.
What is the correct way to migrate a 6.2 installation to a different server?
Updated by Markus Klein about 10 years ago
Do not transfer the typo3temp folder. This is a local folder; you do not even need to backup it.
Updated by Thomas Mammitzsch almost 10 years ago
with php-fpm you might need to restart the service, after removing typo3temp/Cache/*. At least that worked for me.
Updated by Helmut Hummel over 9 years ago
- Status changed from New to Resolved
This is an opcode cache/ webserver issue, we cannot resolve within TYPO3. However we greatly mitigate the troubles by integrating composer class loading (partly as well in 6.2), so the issues described here will not occur