如何在linux上运行PHP脚本? [英] How do I run PHP script on linux?
问题描述
抱歉,我是Linux和Php的新手,所以我一直在努力运行脚本,主要是因为我所做的所有练习都是在我的var / www / html目录中的一个名为index.php的文件中。我想从不同的文件夹运行一个脚本,因为在这个文件中我无法创建任何其他文件,因此我无法处理我的项目。我该如何做到这一点以及如何在localhost上运行脚本?
我尝试了什么:
我尝试在其他目录中创建一个脚本但是无法在localhost上运行它,或者我只是不知道如何。
Sorry, I am a new in Linux and Php, so I have been struggling to run a script, mainly because all the practice I did was on a file called index.php in my var/www/html directory. I would like to run a script from a different folder, as in this one I cannot create any other files and so I can not work on my project. How am I supposed to do that and how will I be able to run the script afterwards on localhost?
What I have tried:
I tried creating a script in other directory but couldn't run it on localhost, or I just don't know how.
推荐答案
如果你坚持不从默认文件夹运行你的脚本,那么检查一下: [ ^ ]
If you insist not to run you script from default folder, then check this out: [^]
您必须使您的var / www / html完全访问
You have to make your var/www/html in full access
chmod 777 var/www/html
这篇关于如何在linux上运行PHP脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!