PhpStorm setting the Document Root - phpstorm

PhpStorm 2020.1
Windows 10
Apache installed with XAMPP.
I am trying to get PhpStorm's built in server to recognize a document root. PhpStorm keeps running localhost:[port]/[project folder]/default.html. It should be running localhost:[port]/default.html
Because it keeps placing the project folder into the path, all the links fail.
I have edited the c:/xampp/apache/conf/httpd.conf file to change the document root and confirmed it in the console, that didn't work. Even setting the document root to the project folder didn't work.
It appears there is a setting or a different conf file that need to be adjusted, but I can't find it or figure out what is missing from the documentation.

Related

How to make PhpStorm access a proper directory?

I'm running Linux Mint. My existing projects are located at the /var/www/* folders. But when I'm trying to create a new project then the PhpStorm's file browser is not showing me that folder at all. Like there is just no /var/www folder, but I know it is there and is having a full access permissions (0777).
In addition it shows for example a folder /var/data/JetBrains which is not actually available in my system (terminal: cd /var/data - no such file or directory).
So it seems like it is showing some kind of its own /var folder (virtualized?), not the one that is actually in my system. How can I solve this problem, how can I make it so it use my system's /var folder?
Solved. Do not install the PhpStorm from the Mint's software manager. It comes there in some kind of wrapper that isolates the filesystem.

MAMP Pro can't see index /

I'm testing MAMP Pro demo and I created a few wordpress folders in the htdocs of the MAMP folder. Whenever I attempt to launch the WebStart, I get to a web page that tells me MAMP Pro was correctly installed, but whenever I attempt to access the localhost:8888 page, instead of seeing the index of wp instances, I only get this message:
The virtual host was set up successfully.
If you can see this page, your new virtual host was set up successfully. Now, web content can be added and this placeholder page1 should be replaced or deleted.
Server name: localhost
Document root: /Applications/MAMP/htdocs
1 Files: index.php and MAMP-PRO-Logo.png
Any help?
Thanks!
Helo, in my case, the problem was solved by removing index.php and reloading the project folder in htdocs.
Check the folder that the files are in and see if there’s a file in there called ‘index.htm’ or ‘index.html’. Basically, anything like that isn’t ‘index.php’ (that’s the WordPress file). If you find that, then delete the file.
Deleting the file index.php hopefully you'll fix that problem

For PyCharm/WebStorm my IDE's local server is not detecting other directories

When I select a html file to open "in browser" in Webstorm it works and it opens under the localhost. The issue I'm having is that this webstorm internal server is not detecting any of the other paths in my project root like images and javascript files.
I should note that this feature has worked before on other projects I started from scratch using "new project." The difference with this project is that I opened a directory as a project.
The built-in webserver serves files from http://localhost:<built-in server port>/<project root>. Forward slashes in URLs tell the browser to resolve them relative to the web server root (localhost:63342 in your case), causing 404 errors.
If you like to change the default web path on built-in web server, you have to re-configure the server by editing your system hosts file accordingly - see http://youtrack.jetbrains.com/issue/WEB-8988#comment=27-577559.

making an html file accessible outside of ubuntu using apache2

I am new to Ubuntu and am trying to create a html file that I can access outside of Ubuntu using apache2. I am using ubuntu (12.04) within a vmware player. I have installed apache2 and created a html document using text editor, which I can open it using a browser within ubunutu, but when I try to open in my regular browser - windows 8, it cannot find the file. I know that it is finding apache2, cause when I type the ip address in the windows browser it says It works! so the problem is I do not know how to save/convert the html file i have created in the text editor so that i can open it in my windows browser. Can someone please instruct me on how to do this? thanks.
Put your file in /var/www/
save it as index.html
If you dont name the file "index" apache will show you a listing of all the files in "/var/www".
You will need to get use to using a "command line", this is how the things your getting into are done.
Example:
sudo mv index.html /var/www
This command will move index.html to /var/www
Here are some vids that will point you in the right direction
Introduction to Servers:
http://www.youtube.com/watch?feature=player_detailpage&v=CDxaRfwzFrs
Basic Linux Tasks:
http://www.youtube.com/watch?feature=player_detailpage&v=OnSUX2otYos

MAMP htdocs phpinfo

I am trying to get a simple phpinfo() to print out on my local server (using MAMP). I made a new directory in /Applications/MAMP/htdocs (php_sandbox) and put a file in there named my_phpinfo with only phpinfo() in it. How can I view the contents of this file in my web browser?
Is it also advisable if I set the Apache document root to be in my home directory/sites? I will be mainly using this local server to test/host some small sites.
Thanks!
visit in your browser localhost/my_phpinfo/index.php assuming you named the file with
<? phpinfo();?> is in index.php. Also, make sure you are editing the correct php.ini in your MAMP directory by checking your mamp prefs and seeing what version of php MAMP is using.
Your in the right folder by default from what I remember. MAMP runs apache on port 8888 by default. You should be able to go to http://localhost:8888/ You can also get to this page via the control panel (should have a button to open home page). This page will also show you've configured MAMP's Apache to run on a different port.
Whatever you name your file; you'll want to give it a .php extension, so if you file is named my_phpinfo, add a .php so it becomes my_phpinfo.php. Make sure you function called is wrapped in php tags like so
<?php phpinfo(); ?>
If this file is directory in the htdocs folder you should be able to go to http://localhost:8888/my_phpinfo.php and get the PHP Info page.
As far is moving the directory. I normally do. Especially b/c it makes upgrading MAMP a little easier (already have to worry about MySQL). You might have to tweak the file permissions just a bit to make sure it runs correctly. I believe though you should be okay since it is running as your User.