HTML project in netbeans - php

Ok I just installed netbeans for php and i'm trying to create a new project for html/javascript but I only see php project there.
I can create a php project and just create html files inside of it, but it makes me define a project path to localhost. So when I try to run my project, it directs to localhost instead of my project's root folder.
Sorry I'm new to this piece of software so excuse any ignorance.

It redirects because php requires a server. If you have plan to make a project for html and javascript alone you can try with some good html editors like dreamweaver or other IDE's.

Related

Eclipse for PHP, how to make it to include downloaded files in project?

first of all I explain the reason why I try to do it.
I tried many editors/IDEs which could provide convenient syntax and variables check. Eclipse did the best.
But it works correctly only if I work with its project, otherwise there are a lot of glitches and no correct support of syntax suggestion/auto-complete.
I set my FTP client to download files into project's folder, but Eclipse does not recognize them as a part of this project so I still don't have it's full support. If I create PHP files with Eclipse in the same folder it works just fine. Is there a way to make read all PHP files in project folder as parts of a project?
Or, if you can suggest IDE which performs syntax check/auto-complete tasks as Eclipse does please do, I check if I tried it. I can't include all CMS into project, because it is Bitrix, it can kill any IDE which can try to chew it, so I just need a reliable tool which could work as code validation of currently edited script. The perfect tool could just be set for PHP 5.6/7.1 for example and perform validation based on language rules.
If you are trying to get Eclipse php support for randomly downloaded files you can set your FTP client to download that files in project's folder. Then you open Project Explorer in Eclipse, press refresh button to get actual folders/files list, find you file in there and open it by that project explorer. That makes Eclipse to consider that file as a part of your project so auto-complete and validation works fine. Other ways of opening it does not count.

NetBeans - AngularJS project within a PHP project, all using the same git repo

I just inherited an application that is Magento with an Angular frontend. The Angular code is wholly contained within a single subdirectory of the Magento application. I can set up a PHP project in NetBeans and I get PHP autocomplete and other goodies, but no love for the Angular .js files. The goal is to have both PHP development goodies and angular development goodies. All the code is in one git repo (else this would not be an issue, I could just have two separate directory trees).
NetBeans will not let you create a project within a project. I've tried stitching the codebases together with a symlink both directions, and either git doesn't like it (refusing to treat the symlink as a directory), or NetBeans doesn't like it (still seeing the Angular files as residing with the already existent PHP project).
Anybody have any ideas? Changing the repo structure (like using a git submodule) is not an option currently.
You cannot make "a project inside a project", that is correct. :)
In your project, check if in Remote Files (next to Source Files in the Projects tab) you have the necessary JS files. If not, you have to link to them in your project.
Also what version of Netbeans are you using? It should work in the latest ones (8.1 and up) but may not work in earlier (8.0 and below).

How to get PHP working in Brackets?

I'm almost finished my first website. All that's left is the contact which I will do with PHP. So far I have been using Brackets for coding HTML5 and CSS.
From my research I understand that I need a server to run PHP so I installed XAMPP. I have relocated my project inside the htdocs folder of XAMPP, however when I try to open up my PHP page in Brackets' live preview I get this.
Found out whats wrong, I had to go to project settings in brackets and adjust the directory to match the location of the project inside the xampp directory.

Using gulp livereload with XAMPP

I been using gulp for front-end development lately and I find it very helpful.
I use XAMPP in windows for making PHP website some of which sometime include database operations.
Now, I have used gulp-livereload and gulp-connect for starting a server for front-end but then it won't process the PHP files.
All I want to do is, PHP livereload with database access. Like livereloading but via XAMPP's server(since it can process PHP).
yes, I have found a temporary solution for now.
See, it's just temporary but as long as you write PHP correct, you will get the work done. Let me tell you how I do it.
Though right off the start I want to tell you that this is not a proper way to approach this, you should use some MVC framework.
Anyway,
I have XAMPP installed under Windows 8.1 and XAMPP's htdocs is in my "C" Drive.
I then create a folder inside "htdocs" in which I put all my frontend + backend code.Basically, gulpfile.js is at the root, then there is a components folder in which all front-end sources reside. There is another folder at root called "www" inside which I put my index.php.
Then I load gulp-livereload instead of gulp-connect and I add the livereload.listen(); method and Tags in all the php files I want to reload.
Works very fine except when PHP throws an error, untill you correct that error, you have keep reloading the page manually.

Deploy PHP website on Heroku

I have got heroku up and running just now. Not sure how to use the PostgreSQL and how to deploy my website though. It is a few php files. But they php files don't open they are just blank so I guess it is never leaving the index.php
Do i need to include or list all my php files in the default index.php file?
Also with the database i created one and it is in the dashboard listed under apps so now can I connect to it normally or is there more stuff to configure?
Would love some video tutorials showing how to deploy small database driven websites written in PHP to heroku.
Any help is great! Cheers guys :)
If you want to use postgresql database with your website on Heroku, you need this add-on. To set it up read this https://devcenter.heroku.com/articles/heroku-postgresql post.
As for PHP, you seem new to it. To include a file you need to use either require or include.
You can look at this video, for basic deployment of PHP on Heroku.

Categories