PHP not executed

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

PHP not executed

Postby AndrewKKWalker » 27. March 2009 01:54

I have just installed XAMPP for Windows on Vista PC
Lot's of programming experience, BUT none with PHP.
Trying to test first Small PHP script.
Tried the Index.php from XAMPP as well.
Everyting appears to have installed OK, and All Services running.
Have put php script files into htdocs folder as suggested,
but when try to open in a browser window NOTHING shows.
XAMPP index,php says there is an error in installation,
my simple php echo command shows nothing, but standard html is fine.
Tried it with IE7, IE8, Firefox, Opera and Chrome (same thing in all).
It appears that the PHP is not running, everything else inc Javascript is fine.

I am doing something wrong but what I have no idea.
Any help greatly appreciated.

AW :?:
Andrew
AndrewKKWalker
 
Posts: 33
Joined: 27. March 2009 01:46
Location: Cambridge England

Re: PHP not executed

Postby Izzy » 27. March 2009 02:01

Search your PC for php.ini files and delete or rename those you find that are not in the xampp installation folder.

Then if you find any and after renaming or deleting them, restart Apache and try again.

Also check in the Environment Variable under System variables that you do not have this entry:
SetEnv PHPRC "path" <-- this section will contain a path.
If found then delete it and follow the above restart procedure.



Also to be able to do many essential tasks in XAMPP you need to be logged into Vista as an Administrator and to have disabled UAC or as a Super Administrator which is the Vista equivalent of the 'root' user in Linux.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: PHP not executed

Postby AndrewKKWalker » 27. March 2009 02:37

Tried that.
The only php.ini file is in the xampp folder and the xampp\Apache folder
Still no joy.
I stopped and started the Apache server as well.
Also discovered the same files fail in Web Expression 2

On another subject, phpMyAdmin also fails with the message below

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

MYSQL has a password on root, and it looks like it is not using this.
Must be some config file somewhere I need to set it up in but again no idea where

AW
Andrew
AndrewKKWalker
 
Posts: 33
Joined: 27. March 2009 01:46
Location: Cambridge England

Re: PHP not executed

Postby Izzy » 27. March 2009 02:41

Sounds like MySQL is not running.

Go to xampp\xampp-control.exe the XAMPP Control Panel (XCP) and see if next to MySQL and Apache both are showing the green running indication - DO NOT click on the Admin... button next to MySQL or you will have lots more issues to contend with.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: PHP not executed

Postby AndrewKKWalker » 27. March 2009 03:37

They are BOTH running OK.
Unfortunately, at some point prior to this I had clicked on the Admin button next to MYSQL.
Maybe that is where all my issues came from.
I had to stop the WINMYSQLADMIN.exe from running using MSCONFIG because it caused havoc on re-boot.
I have MYSQL running on other machines and never had a problem with it.
XAMPP itself also reports <YSQL is running OK,
and if a I use the GUI interface to mysql and enter the root password everything is fine.
Indeed it looks like all is well other than phpmysqladmin which cannot communicate with it at all.

Still have NO idea why none of the php script will display in the browser either.

AW :?
Andrew
AndrewKKWalker
 
Posts: 33
Joined: 27. March 2009 01:46
Location: Cambridge England

Re: PHP not executed

Postby AndrewKKWalker » 27. March 2009 03:46

Also, where would I need to look to find the Environment variables.

Also check in the Environment Variable under System variables that you do not have this entry:
SetEnv PHPRC "path" <-- this section will contain a path.

Cannot see, to track this down anywhere to check it.

AW :?:
Andrew
AndrewKKWalker
 
Posts: 33
Joined: 27. March 2009 01:46
Location: Cambridge England

Re: PHP not executed

Postby Izzy » 27. March 2009 03:50

XAMPP itself also reports <YSQL is running OK,
and if a I use the GUI interface to mysql and enter the root password everything is fine.
Please explain what these 2 mean as I have no idea what YSQL is or the GUI you are talking about.

In XCP is the Svc box ticked next to MySQL?

What do you see when you go to http://localhost or http://127.0.0.1/ in your browser?

Windows Control panel under System>Advanced tab for Environment Variables or a Windows search under Help for Environment Variables may give some results..
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: PHP not executed

Postby AndrewKKWalker » 27. March 2009 04:03

I see the
Welcome to XAMPP for Windows Version 1.7.0 ! screen when I use either of the URL's in a browser

The Environment variable was not there.

<YSQL was a typo I meant MYSQL

The GUI Interface is the MYSQL Administrator tool that you can download from MYSQL Site.
I can use it to log onto and use MYSQL, so MYSQL itself is performing correctly.
It is just the php Admin component from XAMPP that does not seem to work.

I might try doing the whole install on a different PC to see if it makes any difference.

AW
Andrew
AndrewKKWalker
 
Posts: 33
Joined: 27. March 2009 01:46
Location: Cambridge England

Re: PHP not executed

Postby AndrewKKWalker » 27. March 2009 04:05

OOPS, forgot this

In XCP is the Svc box ticked next to MySQL? Yes!

AW
Andrew
AndrewKKWalker
 
Posts: 33
Joined: 27. March 2009 01:46
Location: Cambridge England

Re: PHP not executed

Postby Izzy » 27. March 2009 04:38

AndrewKKWalker wrote:I see the
Welcome to XAMPP for Windows Version 1.7.0 ! screen when I use either of the URL's in a browser
Then XAMPP and PHP are working as they should - the Welcome page is very much PHP coded, see the source code.

Check the CD Collection demo to see if MySQL in XAMPP is working and just to be sure XAMPP is functioning as it should then test out the other demos except those in the Special menu item as they have a know bug.

AndrewKKWalker wrote:I can use it to log onto and use MYSQL, so MYSQL itself is performing correctly.
It is just the php Admin component from XAMPP that does not seem to work.
IMHO it is not configured correctly and is preventing phpMyAdmin from working, so all is not well with your GUI thing and XAMPP.

AndrewKKWalker wrote:I might try doing the whole install on a different PC to see if it makes any difference.
If you install the same GUI and XAMPP then you will more than likely have the same problems and If installing again then don't use the GUI just phpMyAdmin as it can do what the GUI can do only without all the bells and whistles that are not required.


My guess is that you have a conflict with that MySQL Admin GUI thing and XAMPP's phpMyAdmin and the setting of the root password which it would seem phpMyAdmin can't find because this GUI has it configured in it's own folder.

IMHO this GUI is totally unnecessary if you use XAMPP and phpMyAdmin and if you have it configured incorrectly to take into account the components and their locations in XAMPP then you have introduced a conflict of interest.

Here is a post about the GUI and perhaps how it is configured.
viewtopic.php?f=16&t=33978

I experimented with this GUI and found it to be designed for use with a stand alone MySQL installation not for use with XAMPP, so I jettisoned this bloated over pompous piece of drivel and returned to the sane world of XAMPP and what it has to offer not to mention the recovery of much better used disk space.

I believe that the GUI has set up the MySQL service and is why the tick is present in the Svc box in XCP.

If you want my opinion then dump the GUI and use phpMyAdmin and don't try and use both as it is not necessary.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: PHP not executed

Postby Nobbie » 27. March 2009 09:54

How do you "open" the php scripts in your browser?

*DONT* use "File->Open" or similar, instead enter http://localhost/test.php in the Browser Input (http://localhost/test.php assumes script test.php in htdocs folder).
Nobbie
 
Posts: 8767
Joined: 09. March 2008 13:04

Re: PHP not executed

Postby AndrewKKWalker » 27. March 2009 18:25

Many thanks for all the feedback.

The PHP scripts are now running ok.
My fault, I think it was not a problem, I was just trying to open them the wrong way, being
too inexperienced to know how to do it properly.
I am now 24 hours older and a lot wiser, and all is hunky dory in the PHP world.

Also (I know not how), I appear to also be getting phpMyAdmin as well.
It just started working.
I did a bit of blind tinkering in config files and must have resolved it,
or divine intervention (I have no idea), but I am getting there.

I also have the MYSQL GIU working if needed at the same time, as well as
'SQL Manager Lite for MySQL' which is a great little interface.
I already knew how to use these, so I will now go and explore the wonders of phpMyAdmin.

I will also avoid that Admin button next to MySQL in the XAMPP control panel, like the plague.

I am now off to explore the wonders of PHP, but rest assured, that next time I am up a gum tree,
I will be back to pick your brains again.

Actually, I am probably shortly going to place a question about using PHP with MS SQL Server,
but this is probably the wrong forum for that.

Thanks for help.... Andrew
Andrew
AndrewKKWalker
 
Posts: 33
Joined: 27. March 2009 01:46
Location: Cambridge England

Re: PHP not executed

Postby AndrewKKWalker » 28. March 2009 13:52

As a follow up.

I installed the XAMPP package on a different Laptop as a stand alone yesterday.
All went brilliantly and started ok.
Went into http://localhost/phpmyadmin/ (no problem).
Then misguidedly decided to change the the MYSQL root password.
Foolishly assumed that if I did it here then all would be well with the world and next time I used it it would be OK.
Oh how wrong can you be....
Password changed for MYSQL and accepted.
Cam out and went back in again.

Yep, Cannot find it because now MYSQL has a password, but as far as I can see phpmyadmin doesn't recognise the fact.

So anyway I tested first with http://localhost/phpmyadmin/? - The ? at the end is part of the URL I entered

Hmmmm Straight in no questions, but if entered as http://localhost/phpmyadmin - NO MYSQL Connection

I tried checking the file config.inc.php in the folder C:\xampp\phpmyadmin as suggested somewhere.

Added Password to Line $cfg['Servers'][$i]['password'] = 'mypasswprdhere';

Saved it.

Even Stopped and Started MYSQL Service

No difference, didn't want to know.

So, just to see if it was actually using this file I edited the line

$cfg['Servers'][$i]['auth_type'] = 'config';
to be
$cfg['Servers'][$i]['auth_type'] = 'html';

Ran it, and it prompted me for user and Password (which is the solution I am currently using),
and also shows it does use this file.

(Oh, and I did quadruple check the spelling of the password in both locations)

So anyway... My Next Question ........

IS THERE ANYWAY that I can set the MYSQL Password for root AND get phpMyAdmin to work OK from http://localhost/phpmyadmin/

I seem to have it working on the main system by mindless hacking, BUT I have no idea how.

I cannot get the same result on the laptop, though.

I can live with solution, and to be honest I have other tools to administer MYSQL, that I am more familiar with,
if I need to install them. So this is now just an academic exercise for me.
I just hate to be beaten by technology, and if no one can tell me why, I will waste my time
finding the answer just for the heck of it (sad I know).

Andrew
Andrew
AndrewKKWalker
 
Posts: 33
Joined: 27. March 2009 01:46
Location: Cambridge England

Re: PHP not executed

Postby Nobbie » 28. March 2009 14:52

>Then misguidedly decided to change the the MYSQL root password.

The problem is not to change the password, the problem is HOW and WHERE did you change the password?
Nobbie
 
Posts: 8767
Joined: 09. March 2008 13:04

Re: PHP not executed

Postby AndrewKKWalker » 28. March 2009 15:35

"The problem is not to change the password, the problem is HOW and WHERE did you change the password?"


I can tell you that.....

The first time I had issues I did it with a MYSQL Command Line on the Main machine (Obviously wrong) - That was on the main Server here
The next time (on the lap top) having fallen foul of using the command prompt, I used the Priviliges Screen from phpMYADMIN.

By selecting the root user in the list, and then using the Change Password option at the bottom ... It looked logical enough to me

I'd put an image here, but not sure on this board what ought to go between the Image Tags to get it to appear?
Since the image file is on my PC, not on a web page.

Anyway, back to the reply......
Neither worked, but as I was unable to see the future I did not know that.
Hindsight is a wonderful thing.

OK, from your comment, my assumption is that there must be place to do this so it works.

The answer I am after is, 'WHERE IS THIS PLACE, AND HOW SHOULD IT BE DONE?
Because for the life of me I have not been able to find it out, and have had NO RESPONSE yet from this forum that enlightens me with that knowledge.

Maybe it is documented somewhere, maybe I have not read that info, maybe I have not found that info to read it.
OK, I haven't or I would not be here asking. So I am still at this stage NONE THE WISER.

I have other tools I can use for the job.
I had a good look at phpMyAdmin to see what it can do.
Has some nice features as a GUI to MYSQL, but certainly not the best I've used. although it does have its place in the great scheme of things.

Love to know the answer..

Andrew
Andrew
AndrewKKWalker
 
Posts: 33
Joined: 27. March 2009 01:46
Location: Cambridge England

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 43 guests