How to run php file in eclipse juno - java

I am new to PHP.
I am using eclipse juno. Now, I want to use PHP in my eclipse. So, I installed the PHP plugins using new software installation.
I need two things to do.
1.created a PHP project, and php file but I am not able to run the PHP file. When I try to run it, it is showing
Page load failed with error : Could not connect to server.
2.I have a project already in eclipse, I need to add a PHP file to it.
First of all is it possible or not.
I am able to create a PHP file but even here also I am not able to run the PHP file. It is not showing any output, when I run it on tomcat server. I read that I need to download php-java-bridge.war file, I downloaded it but don't know how to add to the project.

To run PHP file you need a server running which understands how to handle php files.
One of the ways to do that is to run apache web server with php installed.
If you want to use tomcat and php-java-bridge.war, from what I see on their website, you probably need to create a new project from extracted war and start adding files to it.

First of all,we need to download and install the XAMP web server which is used to run the php files.
You can see how to download and installing XAMP in mac in this below video.
https://www.youtube.com/watch?v=h4m2k1Cmx8I
To run the PHP files, first start the MySql Database, Apache Web Server, and ProFTPD in the XAMP server. And also, we need to create the project inside the htdocs folder. If you want to run a PHP file in the existing project, you can store a copy of that project in this folder.
This will help to run the PHP files.

I am a PHP Developer and It's better to use other IDE like Zend Studio and PHP JetStorm and as they are not free you know how to get it.You are newbie to php so I would highly recommend Zend Studio IDE as it is made from Eclipse and has the integrated debugger in it.
Just refer to this link
What is the best IDE for PHP?

Related

I want to create setup for my Java project developed in Netbeans and have Mysql Xampp

Project is Developed in Netbeans IDE in Java Language.
Database connected to it is MySql that runs using Xampp.
The project is complete. Now I want to launch it.
I do not know..
1. How to create the setup which will install this project on clients Windows.
2. How this setup will use the database that I have created and Install it on clients PC.
3. How the database will start automatically on his PC as on my PC I have to run Xampp manually first in order to make connection through code with project.
I have tried using clean and build but when I run that result file it waits for a second and then nothing happens.
Nothing appears on screen when I run build file unlike when I run my project in Netbeans. How to solve this issue?
The database and xampp are two different things. Xampp provides a database (MariaDB if im not wrong) and thats all.
Java doesn't create "installable" outputs. it creates a jar which can be run with java
(something like java -jar your-jar.jar )
So for your setup you can either install xampp and use its database or install a database as a standalone service and use it. The boot with the system depends on the database but xampp is the easiest as you have to boot the db when xampp opens and you can put xampp to open when windows startup.
As for the jar file it depends on what your program does. Is it a service? then it needs to start-up on its own and you will need to provide a service for windows.
Is it an app that a user will run? Create a wrapper or a configuration that will setup the system to run jar files with double click as the user shouldn't need to learn java -jar the-jar.jar ( have a look at this Running JAR file on Windows )
Lastly about the db / java connection. If your program does not require the database to start up then try to "Delay" the call until its needed. Else you will need to create a retry logic to try and connect to the database after a failure instead of failing the program.
I hope that helped!

How do I use MAMP to display html/php and GWT code?

I have website files running on my local server using MAMP. The project was previously developed using gwt. I have installed gwt and ant.
Where do I put now my html/php files to be able to compile the java files and, in the same time, to display my html/php files on my local server?
Thanks!,
Mehdi
You mixed several things here, I'll try to make it simple:
GWT code is written in java, but eventually it compiles to javascript, so the actual code you deploy is javascript.
HTML/PHP/javascript/css files should be put under MAMP/htdocs
If you have the source code of the GWT application and you want to view/edit it, you can do it in a regular notepad, but i strongly recommend using an IDE (Integrated Development Editor) like Eclipse.

Is Windows Azure cspack.exe open source?

I'm trying to pack my Java Azure project in Mac and I cannot find the source code for cspack.exe. So far, I've managed to run Azure Eclipse plugin and successfully created a project but when trying to deploy it cannot run cspack.exe.
I've downloaded Windows Azure Tools and seen CsPack.cs up to the following lines
// Run CsPack to generate the package
ProcessHelper.StartAndWaitForProcess(
new ProcessStartInfo(Path.Combine(AzureSdkBinDirectory, Resources.CsPackExe),
args), out standardOutput, out standardError);
And I don't really know if this component it's open source or not.
If cspack.exe is proprietary, is there any way to simulate cspack.exe. I know it compresses the project to a zip file but I could use any documentation.
cspack.exe is not open source. It will is packed into the Azure SDK which can be downloaded and installed. There is something Open Source like jJack said, but this is only the API which can be used in a Java, .NET or whatever program, to get access to your configurations, mounting a cloud drive or something else.
The eclipse plugins is using a cspack.exe.jar, which is a commandline wrapper for the original cspack Application.
Azure SDK for Mac can be downloaded Azure SDK. Don't know if the Eclipse plugin is capable to work on Mac yet.
It looks like WindowsAzure4j is open source so if this is what you are using then you are in luck. I would try downloading This and look for the full CsPack.cs file, maybe you can glean the source of the problem from it?

xampp and tomcat and jsp oh my.. how do i tell if its working

Ok recently installed a wamp xammp to be specific.. I have a requirment to use jsp for some server side communications instead of other stuff like php. My main issue is not knowing jsp enough or java for that matter to know whether or not what I'm trying to do is working or if its not and if its not is it cause of the code I'm tempting to try which is a copy and paste solution via Google for "jsp hello world". Xampp reports tomcat as active and running but I copy and paste the jsp code I find to see if it works and when I go to it in my browser I just see the source as if I were looking at it in notepad, so anyone got some advice? This is a stock install if the latest xammp.. the server runs fine other wise php and mysql included.
Make sure that the file has the .jsp extension and that it's been placed in a subfolder of /xampp/tomcat/webapps (and thus not there where you usually drop PHP files).
See also:
Youtube video tutorial - Integrating Tomcat with Apache using XAMPP
Install NetBeans IDE and follow this tutorial: http://netbeans.org/kb/docs/web/quickstart-webapps.html (before running application in this tutorial you must stop your XAMPP Tomcat).
Or if you want to use your XAMPP Tomcat, integrate it with NetBeans, create a web project using that tutorial, create a WAR file (by clicking on button Clean and Build) - this will create a WAR file in your project directory in directory "dist" and then copy this WAR file to your XAMPP Tomcat into directory webapps.
Start small, use NetBeans IDE, read some tutorials and experiment. Later you can switch to Eclipse IDE (IMHO buch better IDE, but requires much more customization than NetBeans).
Dont use Notepad.

How to create a .exe file in netbeans?

I've created a project in netbeans and I want it to be runnable in another computer without having the netbeans installed (just like a .exe in visual basic).
I pressed F11 and I got a lib folder which has a .jar file on it. But then I don't know how to work it out, which one do I have to double click?
Can anyone please guide me?
If you created a java project, then the "other" computer should have the java runtime installed, in order for the jar to be executed there (java -jar your.jar) otherwise if you really want an .exe use one of the many jar2exe converters found on the almighty internet, such as http://www.ucware.com/jexec/index.htm
To run jar file on other computer you should have at least jdk. Their is no need to install NetBeans but you have to first set database connectivity to pc and your database. After connectivity just double click on jar file your project will run.
To know how to create Jar file in NetBeans check this link.
What type of project is this Desktop application OR Web based application ? If you are using java then for Desktop application you need to create a *.JAR and for Web based : *.WAR.
There are simple step to create jar/ war. please follow any tutorial.

Categories