PhpStorm mutualized deployment conflicting server root URL - phpstorm

How to set an absolute project URL, different from the root server URL ?
I look for solutions other than:
Settings: seems out of date (I run PS-181)
leaving server root url empty, tip from Jason Lotito.
The second works for me but the GUI keeps yelling that the server root URL is not specified.
But no longer works if the
Did anyone came with a proper, better solution?
EDIT: How to set the project URL
File
Settings
Build, Execution, Deployment
Deployment
tab Connection: set "web server root URL"
tab Mappings: set "web path on server"
EDIT 2:
So you are sharing the same deployment entry between multiple projects... Why not just make it visible to current project only ... so it become project specific and you enter any data you want without any hacks (as it will have no influence on another project). P.S. The ticket you have mentioned was created long time ago when there were shared entries only. project-specific entries are available for quite few years now... –
I precisely use the same deployment between multiple projects: I have multiple mutualized servers. The only difference between projects of the same server belongs to the "mappings" tab.
Moreover, if I set the Web server root URL to my project domain, I have to hack again the Web path on server ... but putting something (like a /), which is a crappy solution.
Clicking Visible only for this project means that I have to create new deployment for each project (which becomes tedious after 30 copy/paste).
As said in the old ticket, if the Project URL of the mappings tab were an editable text field, all would be much simpler.

Related

PhpStorm remove port from localhost URL

When I run my files it takes me to: http://localhost:63342/leadmandist/index.php
I want it to take me to:http://localhost/leadmandist/index.php
How do I remove this :63342 from the URL as it is causing a "Bad Gateway" error? I want this to apply to all of my files.
I tried removing the port in the settings but it won't allow an empty value and just reverts back to 63342.
I am using WAMPServer. If there is a better solution than what I want then I'd love to know.
The URL you are seeing there is PhpStorm's own simple built-in web server. If you want to use your own web server (Apache/IIS/nginx/whatever) then you have to tell IDE about it:
Settings/Preferences | Build, Execution, Deployment | Deployment
Create and configure new entry (In Place type should do; as long as your files are already located in a place where Apache will be able to serve them from)
The key here is to provide your desired URL here
Mark this entry as Default for this project
Now when you will use "Run" or "Open in Browser" the IDE will use URL defined there as a base for constructing full URLs.

Chrome Workspaces - Saves changes in Sources tab but not Elements

I'm trying to setup and use Workspaces on Canary and I'm running into a few issues.
I understand that is still under development but could someone clarify these issues i'm having aren't or are related to the fact that its still under development?
Basically I setup a workspace in DevTools, locating the directory on my file system. Do I need to put anything in URL prefix and folder path input boxes? I've experimented leaving them blank, filling them in etc, but due to the lack of documentation I'm not sure what the correct input is.
Most of the time I run my sites through MAMP so will custom server names alter the configuration?
When I then open open the page I am editing, open the dev tools, make changes in the elements styles sidebar, it doesn't save any changes to the file on my system. But then when I go into the Sources tab and locate the workspace from the slide-out menu on the left, I can make changes to the files directly there. But I have to refresh the browser to see any changes.
I know something isn't quite right because when I watched Paul Irish's little demo a while back, he was making changes in the elements styles bar and seeing the results without refresh and changes being saved automatically. How can I get that this point?
Thanks in advance.
PS. If someone could add chrome-canary and chrome-workspaces tags, that would be great.
Once you have added a local filesystem, right-click a local file in your Sources panel and choose "Map to Network Resource", then select the network resource it corresponds to. That should set up the right mapping automatically.
URL prefix and folder path should correspond to the root of your app (the root url, on the server) and the root folder of your app in the file-system respectively. Alexander Pavlov is correct - if you set the network mapping for an individual file, and restart Dev Tools, these mappings will be made for the entire map, automatically as Dev tools makes the connections. In other words, do it for one file and you may not have to fill in those fields for the workspace yourself, Dev tools will do it automatically. Very handy.

How can I find my working directory?

You'll have to bear with my slightly on this, but please ask if I have left out any pertinent information. I have just taken over a project to create a dashboard for my team. This dashboard has been made using a niche third-party tool that nobody here will have used before. The third party tool auto-generates some code to display "markers" on a webpage. "Markers" being some proprietary code to query a database/apply custom styling etc.
I am trying to display a webpage within the page that has been generated, and I’d like to point this to a local webpage (ie on my C drive). If I pass it an absolute path, then this results in a warning in IE9 as I am mixing data sources - a https website pointing to a http web page. It will display after ignoring the warning, but my userbase is not comfortable enough with computers to ask them to do this.
I believe if I pass it a relative path then it should work, but I can’t find out what directory to base this path off and it doesn’t appear to be anywhere obvious. So, in my current page I have an image with the web address of : https://website:8443/websitereport/images/buttons/locked.gif. What I need to know is where the “websitereport/images” folder is stored so that I can put my webpage in there to give the webpage a relative path. The HTML for this image is :
<img id="dvp_locationbar_lock" class="dvp_imagebutton" style="" dvp_title="ui.tip.lock-page" dvp_image="locationBarPageUnlockedImage" src="/websitereport/images/buttons/unlocked.gif" title="Lock this page">
What are my options for discovering where this folder is stored locally? I am running Apache Tomcat 7.0. It is not displaying if I use the path based off
C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\work\Catalina\websitereport
of
\websitereport\page.html
And I cannot find it anywhere obvious in the Apache folder. I have tried :
Searching - no results.
Using PHP to print the current working directory - cannot find out
where to edit the webpage.
Looking at images/information on the existing webpage. They all point
to folders I cannot find.
Inspecting with firebug.
In short, you can't rely on the files being on disk at all - they might be just contained in a *.war file, containing the whole application. Or they might be generated on-the-fly, despite the name sounding like an actual file.
Also, you should not arbitrarily write within a directory even if you find it (my closest guess would be tomcat's webapps/websitereport/ directory if it exists) because nobody will know that something changed during the time since last deployment. So, on the next update of the application, you'll end up overwriting all of your changes again. You typically change the underlying application and redeploy.
You might also find a few references in tomcat's conf/localhost/ directory or even in conf/server.xml, but it all depends on how your server was administered

Wordpress - ftp'd site/exported database to localhost, localhost images still point to .com, why?

I FTP'd over the entire wordpress site and exported the Database and got it running on my localhost throught WAMP, but for some reason the links and folder are still pointing towards it's .com, and a 404 error comes up as well.
I suspect it has something to do with .htaccess but I'm not sure.. Can someone steer me in the right direction?
Did you update WordPress Address (URL) and Site Address (URL) under General > Settings?
They might still point to old domain.
Transferring the site over FTP to your local machine is the same as "moving" it to a new domain. Wordpress provides specific instructions for such a move which you can find #
http://codex.wordpress.org/Moving_WordPress
When Your Domain Name or URLs Change
When your domain name or URLs change - i.e. from http://example.com/blog to http://example.com, or http://example.com to http://newexample.com - there are additional concerns. The files and database can be moved, however references to the old domain name or location will remain in the database, and that can cause issues with links or theme display.
If you do a search and replace on your entire database to change the URLs, you can cause issues with data serialization, due to the fact that some themes and widgets store values with the length of your URL marked. When this changes, things break. To avoid that serialization issue, you have two options:
Only perform a search and replace on the wp_posts table.
Use the Search and Replace for WordPress Databases Script to safely change all instances. ( If you are a developer, use this option. It is a one step process as opposed to the 15-step procedure below )

How to configure Netbeans code entry point when you use mod-rewriting

I am developing a website in PHP and I am using mod-rewrite rules. I want to use the Netbeans Run Configuration (under project properties) to set code entry points that looks like http://project/news or http://project/user/12
It seems Netbeans have a problem with this and needs an entry point to a physical file like http://project/user.php?id=12
Has anyone found a good way to work around this?
I see your question is a bit old, but since it has no answer, I will give you one.
What I did to solve the problem, was to give netbeans what it wants in terms of a valid physical file, but provide my controller (index.php in this case) with the 'data' to act correctly. I pass this data using a query parameter. Using your example of project being the web site domain and user/12 as the URL, use the following in the NetBeans Run Configuration and arguments boxes. netbeans does not need the ? as it inserts that automatically, see the complete url below the input boxes
Project URL: http://project
Index File: index.php *(put your controller name here)*
Arguments: url=user/12
http://project/index.php?url=user/12
Then in your controller (index.php in this example), test for the url query param and if it exists parse it instead of the actual Server Request, as you would do normally.
I also do not want the above URL to be publically accessible. So, by using an IS_DEVELOPER define, which is true only for configured developer IP addresses, I can control who has access that special url.
If you are trying to debug specific pages, alternatively, you can set the NetBeans run configuration to:
http://project/
and debug your project, but you must run through your home page once and since the debugger is now active, just navigate to http://project/user/12 in your browser and NetBeans will debug at that entry point. I found passing through my home page every time a pain, so I use the technique above.
Hopefully that provides enough insight to work with your project. It has worked good for me and if you need more detail, just ask.
EDIT: Also, one can make the Run Configuration Project URL the complete url http://project/user/12 and leave the Index File and Arguments blank and that works too without any special code in controller. (tested in NetBeans 7.1). I think I will start using this method.