dongzhi1949 2016-12-23 22:27 采纳率: 100%
浏览 766
已采纳

如何从localhost(Apache)访问php项目

I know this question may first appear to be a duplicate of others, but I'm asking this because I have WordPress installed in my /var/www/html directory. I was learning WordPress a couple of years ago before creating a website and never used it again.

Well, I'm creating a php project using PhpStorm and testing in my browser. I'm following a tutorial so I can configure my databse (phpmyadmin), and the instructor keeps going to his localhost, which displays the directory structure as seen here:

localhost directory structure

Since I have WordPress on my localhost, navigating to that takes me to my WordPress installation, which is not what I want to access.

I would rather ask this question on here before I potentially break my Apache configuration, so how can I access this project? Do I need to remove WordPress completely? It would be nice to keep it for future testing since I'm slowly getting into making plugins.

What are your suggestions? I can't really say much as far as "what have you tried?" since I don't know where to begin.

Running in Chrome within my PhpStorm IDE takes me to localhost:63342/projectName/respectivePhpFileName.php, but I can't access it outside of the IDE yet.

Any help would be appreciated.

  • 写回答

1条回答 默认 最新

  • dou44481 2016-12-26 21:41
    关注

    Just move your Wordpress outside your htdocs folder...I think he is using something like XAMPP so in that way is very easy to do it, because the folder without an index will be detected as a directory not a Wordpress URL (correct me if I'm wrong). So if that doesn't works, just go to your htdocs (/var/www/html or opt/lampp/htdocs in Linux) directory (or where your wordpress is stored) and move it to other folder (like My documents) where you can backup it, and that's it, you can create that folder and keep following that tutorial.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?