I have a problem, I have never used Sublime Text and I would like that when editing a php file, pressing for example the f12 key from sublime, it would open in localhost (Chrome). But I can't do it.
I have the wanpserver active and the address of my project is:
I have installed the View in browser plugin and I manage to open the file with Chsome, but it does it from a relative path and not from my php server with localhost.
Apparently you have to configure the routes of my project. I have read on several sites that it is done in Project -> Edit Project URLs but that option does not appear in the Project menu.
Please see if I'm doing something wrong, I have installed Sublime Text 64. Why doesn't that option appear? did I miss something?
Another method to be able to execute your PHP is that you must save your file in hdocs, which is a folder within Xampp, then you must activate Xampp and put localhost/name that you have given to your document.php and it will be generated for you be it in chrome, firefox, or safari.
I recommend an alternative solution to your doubt, from my point of view, much more practical/useful and that is that I have been using sublime text for 2 years and I think that I have not yet needed something that I cannot use or obtain in sublime.
Therefore, in everything related to browser development I recommend using LiveReload.
http://livereload.com/
Because?
Well, it's a
plugin/addon/libreria
Sublime Text. Its purpose is to refresh the browser each time you perform the save action on your project.Let's say it syncs sublime text with your browser in
Firefox, Chrome y Safari
, that is, for the most common operating systems in browser development/programming.Every time you save your project, it is updated in the browser, it does a simple refresh. By the way, mentioning that the browser's cookies can make it not do the correct refresh as is logical, it seems somewhat logical/silly what I say but when you have been using this for years... you get so used to it that it is almost "mandatory" that each time you keep sublime..MUST! reflect....and sometimes if you forget to remove the cookies, you can have a hard time. "True Story"
My ultimate solution was to work in INCOGNITO MODE.
Yes, you can also use it in incognito mode, LiveReload couldn't be better =).
How to install it?
1-First have Sublime Text installed
2-Install Package Controll
Package Control is a Sublime text library that allows you to manage packages or other plugins/adons on sublime text.
This goes to us
permitir instalar libreria de LIVERELOAD
about Sublime text.Installing the Package control is extremely simple:
2.a) In sublime text, above you go to
views > show console
(Opens console)2.b) In the sublime text console, paste the text copied from this website.
*For both sublimetext2 and SBT3, choose the one you have.
https://packagecontrol.io/installation
2.c) Restart the sublime text when you do installations so that they take effect correctly and avoid crashes.
3) Now
INSTALAR LiveReload
ABOUT Sublime Text3.a) We start Sublime Text again
3.b) Command
Ctrl + Shift + P
, a small window opens in the form ofINPUT
.3.b) Above you type
install pack
and it should be enough to seePackage Control: Install Package
, which is the installer package manager for sublime.You move with the arrows and press enter.
3.c) When you select it (You need internet connection), a list appears with all the packages that you can install in sublime text.
3.d) We must search
LiveReload plugin
and press enter on that specifically.At the bottom left of the Sublime Text editor you can see the progress of the installation.
3.e) Once finished and installed, restart sublime text again.
4) Now
Configurar LiveReload de Sublime
4.a) You access
Preferences > Package settings > LiveReload > settings-Default
4.b) In the file
LiveReload.sublime-settings
, you must have the following code, add everything or what is missing:{ "enabled_plugins":[ "Refresh", "SimpleReloadPlugin", "SimpleRefresh" ] }
5) So far we are done with sublime text. Now the browser remains.
5.a) Search for Livereload + "Your browser" (Ex: Livereload Chrome) 5.b) Install
your browser plugin, in this case we are going to do it with chrome.
5.c) Restart your browser
5.d) In chrome, you will see just above to the right of the browser a circle formed by two arrows representing a refresh or reload cycle with a dot in the center.
6) Now configure the Browser Plugin
6.a) In Google chrome this is as simple as right-clicking on the livereload icon, at the top right and clicking on "manage extension or manage extension".
6.b) We must confirm that this chrome extension is active, and
DEBES MARCAR las 2 casillas pequeñas de "permitir en incognito" y "todos los accesos a url de archivos".
6.c) Once you have checked the boxes. EVERYTHING is READY.
7) How to proceed:
7.a) FIRST OPEN sublimetext the project.
7.b) SECOND you open your browser and go to your project URL Localhost/project/..
7.c)
TERCERO y ULTIMO
, doclic IZQUIERDO encima del simbolo del livereload en el navegador
, and you will see how the dot in the center of the circle is colored and marked in dark.7.d) Now we can say that your browser is synced with Sublime Text.
7.e)
Cada vez que GUARDES el proyecto
, you can use the commandCtrl + S
to automatically refresh and refresh the browser.I hope it helps you, personally I think it's one of the best plugins to work with browser code using Sublime Text. All the best!
PS: Your question is that by clicking, or something you can enter the URL of the web where you are, in this way you get practically the same thing every time you save the project, which we do constantly.
Friend, a query, you want your page in php to see it through chrome. it is easy my friend only in your file to look for the folder that you have created.
You should always save to the path
C: wamp\www\folder name
once saved activate your wamp
Enter your chrome and you have to put like this
www/localhost/folder name/page name