Brackets php live view - php

I recently switched over to brackets as my main coding platform. I am creating a live chat room with a login page using php. Is there any way to set up a live view for php in brackets the same way html is set up? I have the sql and everything already done. Thanks.

Make sure your own local server is already running. Then, go to File -> Settings, and then enter the URL that corresponds to the root folder of your project.
Take a look at the details and limitations of using live preview with your own backend.

Related

hosting an old part of a php site on a subdomain?

This is my first post here, I'm also kinda new to web dev.
I made a new site for a client an changed the hosting of the domain.
But he wants an old part of the side witch is an catalog with sorting functions made with php behind a login. I want to host this on a subsite of the hosting. Can I "copy-paste" this catalog with ftp? i have a copy of the database and the full file of the old website. I know that the php version is out of date and I'm having trouble how to find a way to update this.
When i upload the site i get a permission error trying to visit it.
When I try it locally i get to the login screen and the first page of the catalog, but when i try to select a category I only get a white screen.
I already want to thank you all for the help.

How do I change a wordpress dev site url that was overwritten by live site backup

We have a dev site www.dev.site.co.za & a live site www.site.co.za.
I wanted the dev site updated to be a current replica of the live site, so our hosting provider copied it over.
But now when if you go to www.dev.site.co.za, you are "redirected" to www.site.co.za. I have tried changing the siteurl in phpmyadmin but that hasn't resolved the issue.
Is there somewhere else the url needs to corrected and is there anything else I need to do to make sure the dev site is a completely separate environment to the live site so I can safely fiddle without damaging the live site?
wordpress not only uses the database in PHPMyAdmin for the url.
As mentioned in the official documentation there are several files that can include the url:
the wp-config.php (wordpress file)
the functions.php (theme file)
Check these and have a look for the url address.
Have a look at the .htaccess file!
Also:
Helpful for that issue (e.g. restoring a wordpress page on another server) is the plugin BackupBuddy. It is one of the most well known plugins for wordpress. (Know right now that it is a paid version! But as always there are others with the functionality).
It allows you to backup and restore your page on a new system. You can initially set your new desired address for the system then.
Maybe it is worth a look!
For rectifying your dev site issue, you can try this.
Following is the URL to a simple utility via which you can replace some value in your database with some desired value.
https://github.com/interconnectit/Search-Replace-DB
Download the utility (zip file).
Upload it to your dev site root location and unzip it there. So that the the URL of the unzipped folder becomes: www.dev.site.co.za/Search-Replace-DB-master/.
Visiting that URL will show you the screen with options to replace some values in your database with desired values.
This utility automatically selected the connected database.
Put the URL of your live site in the field to replace.
Put the URL of your dev site in the field to replace with.
Choose the Dry Run option to see what all tables and columns will be affected.
Once you see the results and know what is changing then you the click on Live Run.
Clicking on Live Run will change all the URL of your live site in dev site database with URL of your dev site.
Once the changes are done you can delete this folder.
Hope this will at least resolve the problem of redirection of dev site to live site.
Once the new site is built you can then migrate(move, copy) it to the live site's location. There are some tools out there to help with moving the site you can use once the site is done. Some require a plugin to be installed to do that though. For example magicmigration can be used to move the completed site to a new location (that one specifically doesn't take extra installs). It is also possible to manually migrate the site though depending on the situation and know-how that can be a bit much for some people.

Testing File Updates and Improvements without showing to users

I'm pretty new to web development and as I build websites using an Apache server, I was wondering how to prototype changes. For example, say I'm working on improving a PHP file that is already being displayed on the site. How can I test whether the changes I'm implementing work when the updated file is put on the server without disrupting users to the site if there is an error in the new code?
You should have a local copy of your site on your machine where you can test your codes, if that works, add it to your live website, Simple!

Angular2 & MAMP integration

I am currently using AngularCLI to generate an app for me. When starting npm serve is starts its own server. However, i need to integrate PHP / MAMP and thus it uses it's own web server.
What is the best way to link the two? Very little info on Google but I am probably not searching for the right terms.
first of all, to host your app on a mamp-server you just need to:
ng build --prod
and then copy the files in the dist-folder to the root of your web-server.
But Im guessing that you then want to read and write from the database.
This is my recommendation:
Dont put php-tags in your html, make web-services
e.g. make php-scripts that get data from the database and outputs the as json, then use HTTP to get the data to your Angular-app.
Add root url (hostname) into build js links in index.html,index.html not understand to .css .js files in build folder in hosting time.

Brackets Live Preview not working after moving to wwwroot

I'm using Brackets to dev a static, simple site. The Live Preview capability is fantastic. all was going well until...
I wanted to start using some php in my site so i downloaded php and tested it in my inetpub/wwwroot. I then figured that i best move my static site (html and css files) to the wwwroot folder.
This caused a set of issues i partly resolved. My Live preview started asking for base URL so i put the new local url: http://localhost/myprojectfolder/. HTML and PHP files now showing but...
The Live preview needs me to hit save and restart the preview (defeats the purpose of Live Preview). It also doesn't highlight sections of the page as you scroll through the code.
How can i get PHP working on my site and the Live Preview working, i've messed something up.
Edit: Im using IIS with my PHP hence moving my static site to wwwroot
Brackets has a known issue whereby the Live Preview requires saving of code and refreshing of live preview chrome screen in order to see change. You can also not see the element highlighting once moving to your own web server eg iis.

Categories