Newbie needs to know

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Newbie needs to know

Postby KnightsKnives » 22. July 2006 15:51

I installed XAMPP and it is running. I started the sql sevice and it had problems but I finally fixed this. Now both the XAMPP nt service and the MYSQL service is running properly, or so I think. It shows both of them running properly in status and I no longer have problems starting the service with the nt service.

My problem is PHP is not working. None of the scripts will work when I click on them. What did i do wrong, or what do I need to do in order to get this working. Once I have this working I will be able to start writing PHP scripts. Could someone please advise? Eternally grateful

Knight :?:
KnightsKnives
 
Posts: 7
Joined: 22. July 2006 11:03
Location: United States

Re: Newbie needs to know

Postby Izzy » 22. July 2006 23:48

KnightsKnives wrote:...My problem is PHP is not working. None of the scripts will work when I click on them. What did i do wrong, or what do I need to do in order to get this working. Once I have this working I will be able to start writing PHP scripts. Could someone please advise? Eternally grateful

Knight :?:
It would help enormously if you could post any error messages passed back and also the contents of your error logs that refer to this issue.
As Weidmann's post below suggests, your clicking on a script has me somewhat perplexed.
We can only guess what else might be wrong without providing any clues.
Did you change anything after the initial install?
Also if you have not done too much customizing then often the best course of action would be to completely (and I mean completely) uninstall XAMPP and then do a clean re-install, perhaps to a new location, say C:\... instead of C:\Program Files\... Often this method works well as sometimes an install can be corrupt FNAR. :)
Last edited by Izzy on 23. July 2006 02:54, edited 4 times in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby Wiedmann » 23. July 2006 01:21

My problem is PHP is not working. None of the scripts will work when I click on them.

You can't run PHP scripts with a (double-) click in explorer. You must open them with "http://" in a webbrowser.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Problem still exists

Postby KnightsKnives » 24. July 2006 18:03

I downloaded the Mysql and Php without the appache server. I tried to install both using IIS and found this to be a problem. I have done this before, with IIS and it worked out great. The newer version of IIS was my problem and I didn't want to relearn what I had already learned.

I decided that I would start out with Apache, which I installed manually, and Php and Mysql manually. When nothing worked out I decided that I would try XAMPP and see if this would help.

I do not get any support from php, although I am able to use the PhpMyadmin. I don't know if I have a previous version of Php that is installed and therefore is calling on functions that are trying to be called on by the appache server. I uninstalled IIS and am only using the XAMPP. I looked for uninstall of the PHP and Mysql and found nothing in the windows uninstaller.

I have not yet looked at the registry to see if there are any lingering programs that may be hindering the server. Also, I am not sure if the ini settings for the php are correct when I install XAMPP. I am not sure if XAMPP has already installed php into its' correct path for the server on the usb drive I am using (Highest disk present) and though I looked at the Php in for the XAMPP on the usb drive I have not been able to discern the language of the ini file to see if it is set up correctly. I am assuming that XAMPP for windows has set all of this up when I installed it to the usb. I have not set up the ftp or the mail yet because I need to see if I can execute simple scripts.

I opened MIE and tried the Http:// but this generated the result of could not find server.

Any thing you could suggest would really be appreciated. Thank you for your responses, I have been looking at other things for php yet noting has helped me figure this out. Do I need IIS if I am running Apache? Could this be an issue? Just don't know... thanks for any forth coming answers.

Knight
btw other than server does not exist I do not get any error messages, it just wont access the php script, nothing happens. :shock:
KnightsKnives
 
Posts: 7
Joined: 22. July 2006 11:03
Location: United States

New install

Postby KnightsKnives » 24. July 2006 18:08

I have already tried the install, as I once had it on my c:/ instead of c:/programs. Now I have the installation on a USB drive. XAMPP reccomended this option, or to install it to a different partion in the instructions. I don't know if this has any relevance... but I just thought I would add this.
KnightsKnives
 
Posts: 7
Joined: 22. July 2006 11:03
Location: United States

Postby Wiedmann » 24. July 2006 18:11

I opened MIE and tried the Http:// but this generated the result of could not find server.

Then Apache (from XAMPP) or any other webserver (like IIS) is not running on the server you specified in the URI..

(BTW: What was the server name you have used in "http://"?)
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Server name

Postby KnightsKnives » 25. July 2006 06:50

I believe it told me that it was local host or 127.0.0.1; in any case if I have the php in my C:/Documents Would I then use Http:/localhost/C/Documents/phpinfo.php if that were the file I wanted to open? Also, if I were to use Mozilla could I just double click on the file to open it? I am under the assumption that php is like html only it is a whole progamming language that can do so much more than html. If i try to open an htm file I have no trouble, but then I had not trouble doing that without a server either.
This newbie is just trying to understand the connection. I understand that I can put php into my html file or I can save them to a directory to call the script which is what I want to do so that I don't have to change the html in all the places that need to have changes. I am at K:XAMPP/ I don't understand if K: which is where the server is, is global from that position, also I may have problems with firewalls from my intranet, but I am only running the program on this machine at present and don't intend to go to an intranet until I have more knowledge about the way the server works and if it is setup correctly in the ini file. I looked at the config and it was setup for port 80, so I switched it to 8080 which is supposedly the thing to do if you are just doing intranet and you don't want it accessible to the internet. I am still trying to figure this out and don't intend to give up, I may have to get the book php and mysql for dummies and see if it can help me to achieve my goals. I don't have any problems with writing the code, just getting it to run is my main problem. I haven't yet tried to put it into html and see if I can get it to run. I don't know if this will work. I have tried just about everything I can think of, it may be that I need to look for more than one php.ini files to see if I have conflicting problem but I would suspect that this would generate an error message, and I don't receive any message. It is probably what you are stating, that I don't have it pointing to the script properly. Perhaps there is a name for the server that is other than localhost? if so where would I look for this information? in the config file? then type the right direction?

If you have any more suggestions I would appreciate them,

Knight
KnightsKnives
 
Posts: 7
Joined: 22. July 2006 11:03
Location: United States

Postby Izzy » 25. July 2006 07:51

http://localhost:8080/yourphpscriptpage.php will put it in the browser if the following is correct:
1. you have the file yourphpscriptpage.php in your xampp/htdocs directory.

2. you have changed the default port from 80 to 8080

Things that won't happen:
Clicking on yourphpscriptpage.php will not load it in the browser as it is a language that has to be parsed by a server.
You can, in windows, associate a web browser with the php file extension just as you can with a htm/html file but all you will see is the raw code just like if you associate it with a text editor. HTML can be rendered in a web browser as that is what it does best but script languages like php, perl and C etc. need to be parsed then rendered in a browser.
in any case if I have the php in my C:/Documents Would I then use Http:/localhost/C/Documents/phpinfo.php if that were the file I wanted to open?

You can have your files like the above where ever you want so long as you tell Apache (XAMPP) where they are by changing the document root in the httpd.conf file or creating a virtual host with the document root set in that section of the xampp/apache/conf/httpd.conf or xammp/apache/conf/extra/httpd_vhost.conf

What ever you do you must be aware that nothing on your PC has a brain of it's own. It needs to be instructed to do what ever it has to do. So if you have your server on the K: drive then you need to tell the software via the conf files that this is in fact where my files are. If they are elsewhere then tell the configuration file their locations.

Once you have mastered this aspect then when you type a default address in your browser your browser will know exactly where to go to get them. Without this knowledge the browser is a dumb as a brick wall.

In my opinion you should uninstall XAMPP completely. Reinstall to the default locations and get all thing working out of the box so you can then see how it works and what you need to do to customise it for your own needs. Jumping in with changes before you have a grasp of what things do is open to your having (k)nightmares :).

Localhost is a server host name and 127.0.0.1 is the IP address of that host name. Both are the same thing and are only on your own PC machine often referred to as the loopback address. When you go intranet or Internet your IP and server host name will change completely but the localhost will always be on your own PC.

If you include php code inside a html file then the server will expext the extension to be .php not .html otherwise as I mentioned earlier it will not get parsed and will show as raw php code.

The apache server's render engine reacts to the file extension to do it's rendering. It will have a heart attack if the extension is not relevant to the code it contains. ;)

Reading mySQL for Dummies will not do much for your understanding of php but a google search will give you the desired results for learning php.

The xampp/apache/conf/httpd.conf files look after the server.
The php.ini file in xampp/apache/bin directory looks after the php configurations.
The xampp/mysql/bin/my.cnf looks after the mysql needs.

You obviously need to do some reading but I hope this post will enlighten you somewhat and at least get your php files rendered into you web browser.

Good luck. :)
Last edited by Izzy on 25. July 2006 08:09, edited 3 times in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Php is running but only from the root of K:/localhost/XAMPP

Postby KnightsKnives » 25. July 2006 07:51

I think that when I set the password for the server it made the c: drive unavailable. I can run all my programs from the 1 gig usb drive but I think because I set passwords when I try to call anything from the c drive I get a 404 error. Access denied. What should I do to keep my server secure and still access my c drive with the possibility of later accessing the rest of my network? Is this something that needs setup in the config file of Apache?

I guess I could put it back on my C: drive but then I would still have this problem when I try to access the rest of my computer. Still stumped....

Knight
KnightsKnives
 
Posts: 7
Joined: 22. July 2006 11:03
Location: United States

Postby Izzy » 25. July 2006 08:22

The passwords and the access control are contained within 2 files.
.htaccess and the .htpasswd

Search your C drive directories for these files. You can temporary rename them to temp.htaccess and temp.htpasswd so you can get access back.

Also the xampp\security directory contains 3 files:
mysqlrootpasswd.txt
xampp.users (a text file that you can associate with your text editor).
xamppdirpasswd.txt

You may be able to do things in those files to get access back also.

If you are going to have the XAMPP Server on a USB drive then completely remove the XAMPP Server on any other drive you use.

Good luck. :)
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

no luck yet...

Postby KnightsKnives » 26. July 2006 07:08

I am going to go through my registry to see if there are any remanants of the programs that I installed manually bf I setup XAMPP. I have removed XAMPP from the usb and shut down the services for the nt services. I am now going to use C:/ as my main directory for XAMPP and do another install. This is interesting for me because I did have a server working, I was able to access PHP and MSQL but only on the K: usb drive. I figure if I can set this up in my main directory of C:/ I should have access. I will also configure my firewalls correctly. Hopefully I can get this working this way.

I am sure it has something to do with acessing the root and password and allowing the security measures to be able to access my computer. Also, since I am new to this, and it is unfair to keep asking questions that have a lot of implications because I cannot give enough detail about what I am doing, I will read a book on this topic and get it done. Thank you for your time, and consideration of my problems. IF you have any reccomendations for a good foundation book for the Apache server and PHP Mysql, I would appreciate a suggestion. I am so new to this open source that I would need something even more rudimentary than the documentation that is given by Apache, PHP, and Mysql documentation on line. Something more elementary. Or if you could tell me of your first experience in step by step procedure of how you set up XAMPP for use just on your computer for the sole purpose of development, That would be appreciated as well.

Thank you all for your help, sorry I am so new as to not get it. Hopefully soon I will have an understanding, if not soon, eventually it will happen. I don't give up.

Knight :)
KnightsKnives
 
Posts: 7
Joined: 22. July 2006 11:03
Location: United States


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 81 guests