Link to home
Start Free TrialLog in
Avatar of berba
berba

asked on

PHP has encountered an Access Violation

Just done a new install of PHP, MySQL and PhpMyAdmin using IIS 5.1 and Windows XP Pro and get the dreaded "access violation" when trying to use PhpMyAdmin.

Have searched high and low for a solution to this, and note many people have been raising similar questions for at least five years! I'm guessing that the bug fixes within PHP are now all in place, and I cannot find a recent occurrence of this issue here on EE or anywhere else on google.

I have downloaded the latest stable versions of the software elements mentioned above, so wonder if I've just done something inappropriate in the .ini or config files. I've followed all the instructions pretty closely though, so I'm at a loss on that score.

Any useful ideas?
Avatar of berba
berba

ASKER

Well, I guess if no-one's interested, I don't know how to make my problem seem more exciting...

Seems to me similar things have happened in the past, so I would have thought there is a solution out there that ought to be robust. But others appear to have been disappointed on this site with similar issues, so maybe it's just too much "off message".

Disappointed by the "get answers from experts in about an hour" rhetoric though.

Doesn't seem like a site worth joining. But - hey - I'm willing to be proved wrong!
ASKER CERTIFIED SOLUTION
Avatar of Beverley Portlock
Beverley Portlock
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of berba

ASKER

Notwithstanding the commonness of the "violation" error syntax, I would have thought the very specific circumstances in which this message arose would have been encountered many times before. A squiz around google confirms this, but the solutions that I've seen are old (like 2004) and refer to things like php bugfixes that must have been incorporated in php long ago. Can't help thinking that there's a simple solution here that would be useful to lots of other people too.

BTW, why do you think a reinstall of phpmyadmin might work? I thought it was less of an "install" and more of a "copy the unzipped files into your webroot" kind of thing. What is actually installed anywhere?

Having said all that, I can see that there is little point in sweating the "old way" of separate mysql, php and phpmyadmin installations if there is already an integrated, compatible and compiled version to hand. I'm afraid I'd never heard of WAMP, but having looked at the reference you gave me it seems clear that there is not just one sort of WAMP but many. Can you recommend exactly what WAMP I should go for, why, and where I can get it?

Also, what sort of uninstall precautions do I have to take with the existing mysql? Presumably I can't just do a WAMP install over the top of it and hope for the best!?

I know there's a lot of how/why/where in this, but your help would be much appreciated. Glad I stuck 500 points on what I naively thought was a simple problem!!

Thanks
Before we start this I should warn you that in our offices we threw all the Windows kit out about three years ago and have been on Linux ever since and I cannot help you with IIS.

"why do you think a reinstall of phpmyadmin might work? I thought it wasless of an "install" and more of a "copy the unzipped files into yourwebroot"

This is a fair point  and you are correct - phpmyadmin is a collection of PHP scripts so it makes it more likely that your problem is with PHP , MySQL or IIS. If IIS is working normally then it is PHP or MySQL that may be caused the problem.


"Can you recommend exactly what WAMP I should go for, why, and where I can get it?"
As far as I am aware, there is only one official download.

http://www.wampserver.com/en/download.php


"Also, what sort of uninstall precautions do I have to take with theexisting mysql? Presumably I can't just do a WAMP install over the topof it and hope for the best!?"

Try using the MySQL tools such as mysqldump to export the database in question and store the resulting text output somewhere safe. After the install is complete simply run the data back in again. You had best assume that anything within your PHP/MySQL structure will be lost, so copy them all somewhere else.

If you have the time to do it, why not download the Wamp install on to another PC and install and test it there. If it works then install it on your existing machine. I would also uninstall the existing stuff first and (because it Windows) a reboot before doing the install is probably a good idea.

Avatar of berba

ASKER

Thanks - it's so helpful when someone addresses multiple questions sequentially and clearly like that. Much appreciated!

Downloading the file seemed to bounce off sourceforge.net, and sourceforge appears to have various versions of wampserver that can be directly downloaded from there. Puzzling.

With regard to the uninstall of mysql and php prior to running the wamp installer, presumably this is just a matter of using the mysql wizard to remove the current instance of mysql and then deleting the .ini and config files associated with the two programs.

Mention of the .ini and config files makes me wonder how you tinker with PHP settings and the like once wamp is installed. Do you have to go through the same process of copying an ini file into Windows?

"Downloading the file seemed to bounce off sourceforge.net"

I tried clicking on the link for wampserver which took me to sourceforge and it started to download an executable. Did this not happen for you?


"presumably this is just a matter of using the mysql wizard to remove the current instance of mysql"

I guess so... or the Add/Remove programs in Control Panel. Ironically, given the installation problems I used to have in Linux, the Linux installers seem to give less hassle than the Windows ones - as long as you use the repositories!

Read this https://www.experts-exchange.com/questions/24118846/restore-database-tables-in-MySQL.html about getting data in and out of MySQL on Windows. Make sure you have copies of all your data before you do anything.


"Mention of the .ini and config files makes me wonder how you tinker with PHP settings"

I cannot remember if WAMP has a control panel for this but php.ini is very easy to edit by hand.




Avatar of berba

ASKER

I tried clicking on the link for wampserver which took me to sourceforge and it started to download an executable. Did this not happen for you?

Yes it did. But the fact that I was taken to sourceforge made me wonder what other versions existed there, and they seemed to have several. I guess this isn't an issue so I won't waste your time with it - 'twas merely that I've had experiences in the past where a complex download/installation is followed by a comment such as "why did you choose that one when there's a better version under this rock!"

I cannot remember if WAMP has a control panel for this but php.ini is very easy to edit by hand.

I don't have a problem with editing it by hand, but how does the ini file magically get itself into the Windows directory? Do I have to surgically remove it from somewhere in order to drop it into Windows? Or does the install take care of all this stuff so that the program initialises successfully? And, in that case, where do I find the ini file so that I can edit it by hand?

Sorry for the supplementary how-tos - but I'd rather ask them upfront and feel confident once I turn the ignition key on the WAMP.
"but how does the ini file magically get itself into the Windows directory?"

As I recall, it winds up in C:\php5\php.ini

Just let it install and then do a search for php.ini and see where it turns up.
 
Avatar of berba

ASKER

OK - makes sense!

I'll fire up the WAMP this afternoon/evening and get back to you with results asap.

Thanks for the help so far...

Rgds
Avatar of berba

ASKER

This recommended solution didn't actually solve the problem, it simply made the problem irrelevant by pointing me in the direction of a much better, much simpler, much quicker way of doing things! Very much appreciated.
I take it that everything worked out OK?
Avatar of berba

ASKER

Everything went very smoothly - as you predicted!

Many thanks for your help in trying to find what was going wrong with the interactions between the individually installed packages. But, as you suspected, the best method proved to be the simplest.

Rgds