How to configure PHP on http-server - php

I'm doing a project that involves using a server to host files on the web. I'm very new to web hosting technologies and I found an angular tutorial that used a very simple server called http-server and with this tutorial I was able to get a site hosted to localhost. Getting something hosted using the tutorial required to know very little about how each individual step was working. I want to use PHP but also being new to that, I know that it's server side and I need the server to have PHP installed but I have no idea how or if it's possible given this tool.
I'm not sure if have to move to a larger scale web server with php installed by default like Apache, but I'd prefer to keep it simpler if possible. Here's a link to the tutorial and server utility if that helps at all
https://docs.angularjs.org/tutorial/step_00
https://github.com/indexzero/http-server

If you really want to publish anything "on the web", there's really no need to create a webserver on your own. Any provider you choose will have everything you need preinstalled for very little money, usually in the form of a LAMP stack. (Linux/Apache/Mysql/PHP). The DIY webserver you tested is a security risk at best if you're online with it. And simple as it may seem, the AngularJS server is surely more trouble than just using a pre-installed LAMP, especially when you think about maintenance. If you do not plan to use a commercial webhosting provider, tell us what your platform is, and somebody will be able to point you in the right deirection with a LAMP or WAMP install. It's not that difficult, really.

Related

Merging php application into JSF application

Please help me in the solution of this problem
I have developed a JSF web app, say JSFApp. And the team has developed a php application, say phpApp.
We need to merge both applications and run them on same servers, apache tomcat(please refer if any other is preferable).
The two apps dont even need to communicate with each other.
We could have bought two different domain names for the two web apps but we want to deploy both under same domain name.
We want to do something like copying the phpApp into JSFApp's webcontent folder and accessing it as localhost:8080/JSFApp/phpApp. We haven't tried it yet.
Please suggest.
I have had to support legacy PHP applications on Tomcat before. The solution I went with was to use PHP/Java Bridge. See section "I want to use PHP for all tomcat applications. Apache and IIS are not available, but performance is important. How do I install it?" of the FAQ.
This works with Tomcat 6 and 7, it will not work with Tomcat 8.

How can I access a Lotus Notes Database from PHP5

I would like to access our Domino Databases from php.
My php5 is running in an Linux environment OpenSuse and for development Debian based System. Domino Server 8.5.1 is also running on a OpenSuse Server.
Currently I'am accessing the Databases via parsing the web pages from Notes, but that is a horrible way to do that.
Are there any ways or ideas to access Notes an more comfortable way?
Yes, there are plenty of ways. You can use Domino Designer to write a web service on the Domino server to expose the data that you want, and access the service that from your PHP code. You can use REST APIs if your Domino server can be upgraded to 8.5.3 or higher. You might be able to install Domino on your OpenSuse server and have your PHP code invoke Java programs that use the Notes classes in Notes.jar to do the work, or you can actually do that without installing Domino, but you'll have to use the remote version of the classes in NCSO.jar and your server will have to enable CORBA. You can use ODBC and NotesSQL as discussed here. I'm listing that last even though you did put an ODBC tag on your question because Notes databases are not relational and I find thinking of them that way to be too limiting, but if your data fits a relational model and you're comfortable with it, then it might be your best choice.
What Richard said, except I would start with this link for REST APIs. That takes you to the latest product documentation. Richard's link takes you to a slightly outdated page on OpenNTF.

Developing PHP with Eclipse on a remote server (FTP) on Windows

I'm a real klutz when it comes to Eclipse, but I'm also poor, which is why it is the option I've chosen.
I've installed Eclipse 3.5, Eclipse for PHP, and RSE. I've actually gotten to a point where I can create a new (local) project and download all files to my local (Windows) computer. I'm not running any kind of web server on my local box, and am hoping to keep it that way for now.
I've imported my remote folder into my local project, where I can see all my PHP files and edit them. But of course, when I save, it just saves the local copy. Is there no "put" command? Can I not save straight to the server? Or perform an immediate sync of that one file? I certainly wouldn't want to have to perform a complex sync operation after every little incremental change.
I have no idea what RSE really is, nor how it works, and the documentation is, well, cloaked at best, non-existent at worst. Does anyone have some tips for me? What should my workflow be (barring any local server to test)?
Ideally, I would love to be able to open up the entire "project" directly from its location on the remote server and avoid dealing with a "local" copy altogether. Failing that, I would be willing to "get" the entire remote site once, and then manually "put" individual files that I change locally back, provided it's not a cumbersome process. Am I asking too much? Dreamweaver operates this way, but it's support for PHP is limited at best and can't be considered a full-fledged IDE...
I use WinSCP and enable remote synchronization.
Everything that changes on the local system is automatically synchronized trough SCP/FTP onto the server.
Looks like RSE might be overkill for your needs. Here's a similar question and popular answer to your problem of uploading from Eclipse:
How do I add FTP support to Eclipse?
Secondly, you could try out a version control system like SVN - it would take a little bit of time and work to set it up but probably be far more useful than getting RSE going and then you could develop locally, commit your changes to the server and then update the workspace on the server.
Thirdly, there are other IDEs out there, like Netbeans, with built in support for working on remote files.
Sorry to drag up an old topic but Remote System Explorer is exactly what you need. No need for sFTP or a Shell. Setup the connection in the RSE perspective just like you normally would using your sFTP/SSH client.
Open the folder for the first time and you get the login dialog. Enter your credentials. Store them as needed.
Now navigate to your development files and double click or right click to open the file. Eclipse caches a local copy till you save, Ctrl-S.
Need to do some shell work. Right click on a folder and Launch a Terminal. If your files are source controlled, such as svn, you can checkout or update from the terminal.
I use to have Putty, FileZilla and a host of other editors and utilities. Now I never leave Eclipse. SQL, Shell, sFTP, PHP, CSS/HTML, C/C++, Droid, all within Eclipse.
I tackled the same problem recently. I got a web site hosting company and was using SeaMonkey and developing the code on the 'production server' and learned to do development on a 'development server' and then upload the debugged, working stuff to the production server.
So I use Xampp (it's a good, and FREE, local web server you can easily install on your laptop) and I use NetBeans to develop. Netbeans is better than Microsoft tools -- no ballmer involved in the deal.
xampp uses Apache as the (local) web server and provides Mysql and PHP server-side-scripting support.
The quality of these two is HIGH. Just excellent stuff. You will want to get a local web server running on your laptop, do your development locally, then upload using ftp or the Netbeans environment, the files to your 'production web server.'
I messed around with a lot of different unrelated pieces trying to put a local web server, debugger, mysql database together and then got really lucky and found xampp and then NetBeans.
I think #Ɓukasz's note deserves to be an answer on this page - it would have saved me a great deal of time, so hopefully it will do the same for others:
Here is great tutorial for Eclipse: How to setup Eclipse with PHP PDT, Remote System Explorer, Theme Manager, and Drupal Plugins Eclipse + PDT + Remote System Explorer allows you to develop PHP applications remotely.
I will add that downloading and using the smaller Eclipse for PHP Developers and thus skipping step 2 on the blog works just fine.

I need some advice from Experts on how to develop a PHP site with MySQL

I need some advice from experts :)
I will develop a website using PHP and I will use also MySQL. I bought some server space from a Virtual private server including all the service needed.
How should I develop the site? Shall I develop it on my machine at home (using for example Wamp), and when ready transfer all the files to the server? If so what is the best method to transfer also the database?
Thanks in advance!!
linky:
PHP 101: PHP For the Absolute
Beginner
W3Schools
Database-Driven Web Site Using PHP
and MySQL
PHP/MySQL Tutorial
EDIT:
About Development Servers:
your Webhost is never bothered about how you develop your application, neither thay can provide or will ever provide development tools, technologies or space for this purpose. They only host your Application. So, It is your problem
"Shall I develop it on my machine at
home" ?
Yes, because it is the only option you have if you want to do it yourself. The best way to do this is (IMHO), develop the application on your development machine, and test it on a another machine (server) with the specification, nearest to the one your commercial webhost has.
Best of luck
Developing on a local server should be faster since you can preview all the changes "live", without uploading the updated files to the hosted server. So yeah, I'd recommend working locally. I use Wamp myself.
As for the database, you can export it in PHPMyAdmin (ships with Wamp). It should generate a gigantic query (a set of queries, actually), which you can then execute on your site to create the tables and fill them with content.
Best method is to keep two servers. One is your production environment (the purchased one mounted in some rack somewhere). The second is your development environment (virtual machine running Linux, basically a copy of the production server).
You should be doing your development at home using whatever editor/IDE makes you happy (I recommend PHPDesigner). MySQL Workbench works great for creating/editing your MySQL database.
Copying changes over is as easy as rsync for the files and MySQL Table Export for the tables.
I also recommend running a SubVersion server on the Development machine, so you can keep dated revisions of your work (even if you are doing it alone).
It depends on your home setup. There is a way to export MySQL DBs, so you'll be able to transfer the database if that's the route you take. Having something like PHPMyAdmin makes this a lot simpler (comes default in XAMPP, which I would recommend using for a home server if you haven't set one up already).

Should I move client to Lamp or develop on Wamp?

I have never developed for WAMP, the hosting guy for my new client says they are using Windows servers, they can setup PHP and MySQL for me, but they cannot switch to a *nix server.
He said there are some nuances from PHP on *nix Vs. win.
So my question is, if I have never programmed PHP on win, should I go through the hassle of switching hosts (since they cannot do *nix themselves), or are the differences slight enough that it shouldn't be too big a problem for me?
(side note: the state of the clients website has no effect since it is a static all-flash site and is going to be completely rebuilt)
Thanks!
I would suggest XAMPP which is a complete LAMP package which will install on either Windows or Linux.
You can do all your development on your local machine this way.
Edit to address the actual question: Before bringing this up with the client, here are some things to consider:
What is your relationship with the client? Is this a one project deal, or do you hope to continue working for them? Either way, do you want to get a good reference from them? Are you a long established service provider with a high level of trust, or a new face who has yet to prove themselves? How would they respond if you suggest that they change? Would they mind switching web hosts?
How comfortable are you working with Windows in general? Can you can use it with moderate skill and comfort?
What is your time frame for project completion? How long would it take to find a new hosting service and get set up? How will this impact your scheduled completion?
Ultimately, if you decide to raise the issue, the client has to decide whether they want to move to a new hosting company. Some factors to consider there include:
How long have they been with this host? How good or bad is the relationship between your client and their hosting company. What contractual obligations are in place between them? Would your client have to pay to leave?
After you finish the initial development, who is going to maintain and administer the system (you or someone at the client company), and which system do they know?
Now, if you want to use Windows, I'll mention that, in addition to XAMPP, the WAMP server, which will run on just about any modern version of Windows. I used it for a class (where it was required), and then on a development system for a project at work that ultimately ran on a Linux server. Both ran Windows XP. I don't recall needing to make any changes when copying the PHP from Windows to Linux, although I did stay away from any functions which would have been platform dependent. FWIW, I found WAMP very easy to set up, administer, and use.
I'd suggest to avoid windows hosting. There is no much difference for the PHP as it already multiplatform, but windows is not an option for the public host. Less performance, less security, less operability.
Also, note that they never administer php installation, so, it will be trouble in support.

Categories