We help IT Professionals succeed at work.

PHP small app

Jack_son_
Jack_son_ asked
on
Medium Priority
595 Views
Last Modified: 2012-08-29
I have wamp installed on my pc.  I am in process of learning php and apps.  Someone sent me a test app, that has a mysql db, php and js code.  How do I set this up so I can view it as an application on my local computer?  Right now I can open each form only and most of the php forms are showing commands in the browser.
Comment
Watch Question

Marco GasiFreelancer
CERTIFIED EXPERT
Top Expert 2010
Commented:
"and most of the php forms are showing commands in the browser. "

Yes, of course.: php applications runs within a sewrver and are used through the browser. If you look within the test app directory tree, you should find a file called index.php: open that file typing in youir browser http://localhost/<your-test-app-folder>/index.php and you shoud see the main page of that application. Without knowing the app, I can't tell you more than this.

Cheers

Author

Commented:
There is not one included.
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2019
Commented:
you need to provide more detail of the files that came with the app.

1. Is php setup and working? create a file with the following code

<?php
phpinfo();
?>

Open in new window


Save as test.php in the webroot of the apache server and then browse to this file - if you get the php info page comming up then php is installed and working - if not then you need to look at the docs on how to do that

2. Check that MySQL is installed and working. The PHP app will need to connect to this so somewhere you will need to setup the connection parameters (server, username, password, db) - this can be in an external configuration file or in one (or more) of the php files.

The above steps are the basic requirements before you can move forward.
Marco GasiFreelancer
CERTIFIED EXPERT
Top Expert 2010
Commented:
I'm, sorry, but I don't know nothing about that app, so I can't tell you anything -  and this isa true for each other expert you can find here or in some other forum or web community.

Who sent you that app? Why can't you ask him for explanations? Can you provide the list of files of the app? There is no readme file included? No text file at all? What that app is supposed to do?

If you can't answer to these questions, can you zip the app and post it here, so we can take a look at it?

Cheers
Dave BaldwinFixer of Problems
CERTIFIED EXPERT
Most Valuable Expert 2014
Commented:
With WAMP, if you install an application in it's own directory under the web root at "C:\wamp\www", WAMP will list it on the home page at "http://localhost".

For PHP to work properly, it must be run thru the web server.  For the MySQL DB to be usable, you must import it into MySQL.  The easiest way is to use phpMyAdmin which is linked on the WAMP homepage.

You need more than just WAMP and sample application.  The book that I recommend is from Sitepoint called "PHP and MySQL, Novice to Ninja".  http://www.sitepoint.com/books/phpmysql5/
Most Valuable Expert 2011
Author of the Year 2014
Commented:
If you get a Mac and install MAMP you can store your scripts in htdocs.  You can open MAMP and go to localhost to see the information in your web root.  Click on the name of the script to run it.  It's easier than it sounds!
Commented:
First you have to include all your files in a directory and copy that directory in C:\wamp\www ( assuming that wamp is installed on C Drive.)
In the notification area there will be an icon for the wamp server.
Right click on it to get the context menu.
In the context menu select localhost.
When you select that it will open a browser and there all the folders and files in www directory will be displayed.
Double click on the directory name in which you have all your files.
If there is an index.php file there double click on that and it will run the application.
In case there is no index.php double click on the file name which you think could be the home page of your application and it will run the application.
Mohamed AbowardaSenior Software Engineer
CERTIFIED EXPERT

Commented:
If you are having trouble with MAMP, you might install AppServ:
http://www.appservnetwork.com/index.php

After you install AppServ, you can go to http://localhost or http://127.0.0.1 to access your local server, you should be able to put your files in the directory C:\AppServ\www

Author

Commented:
yes, actually it appears to be the wamp server that is the issue.  When I go to any folder under www, it displays the files as a list and when I click on a php file they come up in a strange format, not straight code, but showing classes, etc.
Marco GasiFreelancer
CERTIFIED EXPERT
Top Expert 2010

Commented:
Uninstall wamp and install xampp (http://www.apachefriends.org/it/xampp.html) It works fine in my Win 7 and I suggest you to give it a try.

Cheers
Senior Software Engineer
CERTIFIED EXPERT
Commented:
AppServ works well on Win 7 as well, you should get the local server to work instantly after you install it.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.