Hello, I hope I choose right forum to ask this question. Couple of the days before, my system (OpenSuSE 13.2 KDE) crashed, no matter why. I have had LAMP, configured with Yast-pattern. Everything worked just perfect, but I made backup of my php scripts that made my little web application. When my system crashed, I reinstalled it, and wanted to bring my php scripts back in folder they have to be. After I brought them back in … htdocs, no one worked! I made one test-script to see if php installed right - it worked! Why old php scripts not work? I also tried to copy/paste some of the old: html parts (included) worked, but php again - not! Why? What is wrong?
Since I said I installed LAMP using YaST pattern, you can conclude that I use last stable versions phpmyadmin, php and mysql programs. My linux is 32-bit.
Maybe I didn’t be clear: script worked on the same operating system, they were back up on home folder also, so when I reinstalled system, I just copied and pasted folder with that scripts. Nothing more happened. “New script” is test script to see if I set server right. Scripts made on reinstalled OS work, but those I restore from back-up folder don’t. By the way: I did the thing you suggested (to enable one thing), and nothing new happened. What to do next?
When I understand you correctly, you copied the scripts from somewhere in htdocs to someones home directory and later you copied them back? I do not know which user did the copying, but did you at least check of ownership and permissions are now correct? You could e.g. compare with your “new script”.
Scripts were in my htdocs folder and i wanted to save them from erasing (destroying) that would happen during reinstalling of system. I copied scripts from htdocs in my computer to home folder of my computer. After reinstalling, I got scripts back to htdocs folder.
No, I did not check ownership. What is that I have to know about it? I don’t know how to check, change ownership…
Who did copy it and how was it done. Saying “I copied” is of no value because the computer does not know any “I”. The computer has users, known by a username (and identified by a userid).
And the actions you describe should either be done by the user that belongs to the role of web manager, or by the superuser (root). And in the last case, root should take care to preserve file ownership and permissions.
To check, as root, please go to the directory where those scripts are and display the information of the “new script” and of one of the old scripts (to compare). That goes something like this:
ls -l name-of-old-script
ls -l name-of-another-script
For you to fill in the correct names of course.
You may post that here for advice.
Well, apparently you lost the read permission for the world. And as normally Apache is running as user wwwrun (thus not user root) and group www (thus not group root), it is not allowed to read those files.
chmod -R a+r *
It is not as I would like it, but most probably it was like this all the time, so be happy with it.
And as an afterburner:
Can you please use CODE tags around copied/pasted computer text in a post. It is the # button in the tool bar of the post editor. When applicable copy/paste complete, that is including the prompt, the command, the output and the next prompt.
And as a suggestion:
When you realy are managing a Linux system, specially as it is more then just a single user PC like this one with a web-server running, try to find documentation about the basics of Unix/Linux. You should know about file ownership and permissions. There is more then enough about this on the Internet.