New to XAMPP.

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

New to XAMPP.

Postby Nathan10 » 19. February 2015 22:52

Hello Everyone,

I just installed XAMPP yesterday. I played around with it today and have a few questions about the configuration. I previously used Apache/MySQL/PHP for several years on a different computer. I had installed it piecemeal; first Apache, then MySQL, then PHP, and manually configured the 'php.ini' and 'httpd.conf' files.

With XAMPP, it seems I don't have to do any special configuring. but I want to confirm that. I looked at the 'php.ini' file and found that the extension for 'PHP_MySQL.dll' was set correctly. However, the 'Register_Globals' was set to Off and I had wanted to turn it On. The comments in the file suggested that off was preferable.

In the 'httpd.conf' file, the 'DirectoryIndex' line was correct. But I could not find the line for 'LoadModule php5_module = "C"/path/php5apache.dll' in the 'LoadModule' section. Nor could I find the 'Addmodule mod_php5.c' line as there was no 'Addmodule' section. In addition, I could not find the section headed by '<IfModule mod_mime.c>' to add the 'AddType application/x-httpd-php.php' line. There was a section headed by 'IfModule mime_module>'. Are they the same? I don't think so.

My question is whether these changes are needed under XAMPP? Apache and MySQL turn on without problems. I am able to bring up the localhost prompt in the browser and see the phpinfo() page as well as the XAMPP Welcome and Status pages.

Am I now able to develop a php file and view it in my browser without problems? I have not tested that yet.

I am not a professional developer. I am teaching myself programming.

Thank you in advance for your help.

Nathan
Nathan10
 
Posts: 5
Joined: 18. February 2015 22:26
Operating System: windows 7

Re: New to XAMPP.

Postby gsmith » 20. February 2015 05:00

I'm not going to comment on Register_Globals, I think the comment in php.ini should be sufficient.

As for loading the php module, have a look at conf/extra/httpd-xampp.conf, which you will notice is Include'd in httpd.conf.
So yes, php away.
gsmith
 
Posts: 194
Joined: 29. November 2013 18:04
Location: San Diego
XAMPP version: 0.0.0
Operating System: Win XP to 2012R2/VS 6,9,11,14

Re: New to XAMPP.

Postby Nathan10 » 26. February 2015 21:26

@gsmith,

Thank you for your reply. It was very helpful. I found what I was looking for and my questions were answered.


However, I discovered that my set-up was not ready for me to develop code. I tested XAMPP by trying to run php files I had written on my prior computer. All attempts failed. I compared the httpd.conf file on my old computer to the file in XAMPP and found important differences. I need help in understanding some of those differences.

1)
XAMPP has a line in the httpd.conf file starting with 'ServerRoot'. I did not find that line in the httpd.conf file of my prior IDE. Did I just look hard enough or is this new or unique to XAMPP?

2)
The line for 'ServerName' has the value 'LocalHost:80' in XAMPP while the value is 'www.localhost.com' in my prior IDE. I don't understand what this difference means. Can someone please explain?

3)
The lines for 'DocumentRoot' and '<Directory ' have values of 'C:/xampp/htdocs' in the XAMPP IDE. I used the values of 'C:/Local' in my prior IDE. I understand the difference. I would like to know if I am able to change the root to my prior value of 'C:/Local' or must I keep the values in XAMPP as they are and create a child folder named 'Local' in the parent folder name 'htdocs'? My preference is to change the root value but I am afraid I might send the XAMPP IDE into a tizzy if I do.

Thanks very much in advance.

Nathan

P.S.
When I put files into c:/xampp/htdocs/local', they display correctly when I type the URL 'localhost//local/filename.ext'.
Nathan10
 
Posts: 5
Joined: 18. February 2015 22:26
Operating System: windows 7

Re: New to XAMPP.

Postby cmb69 » 27. February 2015 01:43

Nathan10 wrote:However, I discovered that my set-up was not ready for me to develop code. I tested XAMPP by trying to run php files I had written on my prior computer. All attempts failed.

Please specify "failed". Have you been able to access the files? Was there an error message? Which one? Did your PHP script output nonsense? Did your computer blew up?

While I'm quite sure that the latter didn't happen, any of the former might, though -- and there might be other symptoms as well. It's often useful if you clarify what really happened, instead of making assumptions on how to fix unspecified problems. :)

Nathan10 wrote:However, the 'Register_Globals' was set to Off and I had wanted to turn it On.

No, you don't want to. :) If you have legacy code relying on register_globals=On, rewrite the code. register_globals was one of the biggest mistakes of mankind (well, that's slightly exaggerated, but only slightly). Blessedly, register_globals has been removed with PHP 5.4, so you can't use it anyway on somewhat recent versions of XAMPP.
User avatar
cmb69
 
Posts: 22
Joined: 18. October 2012 03:09
Location: Germany
Operating System: Windows 7 Home Premium

Re: New to XAMPP.

Postby Nathan10 » 27. February 2015 20:05

cmb69 wrote:Please specify "failed". Have you been able to access the files? Was there an error message? Which one? Did your PHP script output nonsense? Did your computer blew up?


I received the 404 Error: Object Not Found.


I did more testing.

1)
I created a 'Local' folder in the 'htdocs' folder and put my PHP files in it. I ran a first program and received the following 2 error messages:

Undefined Index Error: This was for ALL the variables in my $_[POST] array from my input form.
Undefined Variable Error: This was for ALL the variables echoed to my output form.

I ran a second program and received a "Unexpected End of File" error. The line the message gave was the where I have an 'include' command for a footer file. This program also had an input form and echoed variables to an output form. There were no error messages related to those variables. The header and footer files for the first program were included correctly.

2)
I created a 'Local' folder in C:/ and changed the 'DocumentRoot' and '<Directory /path>' values to 'C:/Local' in the httpd.conf file. These were the ONLY changes I made to the httpd.conf file. I ran the same 2 programs as I did in 1). I received identical error messages for both programs as in 1).

It seems to me that some of my PHP code is not being recognized by the Apache server. These programs were written in prior versions from 2006 or so. I followed the instructions in a book on PHP and MySQL written by Larry Ullman.

I can't think of any explanations or even where to continue to research the problem. Please help!

Nathan.
Nathan10
 
Posts: 5
Joined: 18. February 2015 22:26
Operating System: windows 7

Re: New to XAMPP.

Postby Nobbie » 27. February 2015 22:02

It seems you "destroyed" your WIndows and/or Xampp installation. There are so many errors (each of them unknown to me and believe me - i have seen lots of errors), if I were you, I would (first of all) format the hard disk, then install Windows and after installing Windows i would install Xampp. And nothing else.

I dont think that anything else will lead to success. Honestly.
Nobbie
 
Posts: 8762
Joined: 09. March 2008 13:04

Re: New to XAMPP.

Postby cmb69 » 28. February 2015 01:30

Nathan10 wrote:Undefined Index Error: This was for ALL the variables in my $_[POST] array from my input form.

If you request a PHP file via a GET request (e.g. by entering the URL in the browsers address bar), $_POST is empty, so any index you want to access is undefined. These messages might be relatively harmless (nonetheless you'd better fix them sometime).

Nathan10 wrote:Undefined Variable Error: This was for ALL the variables echoed to my output form.

This might be the result of register_globals=Off.

Nathan10 wrote:I ran a second program and received a "Unexpected End of File" error.

That looks like a syntax error in the script. It might be caused by the newer PHP version or maybe by an ini setting.

Nathan10 wrote:These programs were written in prior versions from 2006 or so. I followed the instructions in a book on PHP and MySQL written by Larry Ullman.

Most likely the 2nd edition of "PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide". Maybe you get more up-to-date information on its website. Otherwise I suggest you get some other information about contemporary PHP and start all over. When you've learned the basics, you may go back to your old code and bring it up-to-date.
User avatar
cmb69
 
Posts: 22
Joined: 18. October 2012 03:09
Location: Germany
Operating System: Windows 7 Home Premium

Re: New to XAMPP.

Postby Nathan10 » 02. March 2015 23:03

Nobbie wrote:It seems you "destroyed" your WIndows and/or Xampp installation. There are so many errors (each of them unknown to me and believe me - i have seen lots of errors), if I were you, I would (first of all) format the hard disk, then install Windows and after installing Windows i would install Xampp. And nothing else.

I dont think that anything else will lead to success. Honestly.


Thank you for your suggestion. I spent the week-end doing what you described, but I still have the same problems. :cry:
Nathan10
 
Posts: 5
Joined: 18. February 2015 22:26
Operating System: windows 7

Re: New to XAMPP.

Postby Nathan10 » 02. March 2015 23:18

cmb69 wrote:
Nathan10 wrote:Undefined Index Error: This was for ALL the variables in my $_[POST] array from my input form.

If you request a PHP file via a GET request (e.g. by entering the URL in the browsers address bar), $_POST is empty, so any index you want to access is undefined. These messages might be relatively harmless (nonetheless you'd better fix them sometime).

Nathan10 wrote:Undefined Variable Error: This was for ALL the variables echoed to my output form.

This might be the result of register_globals=Off.

Nathan10 wrote:I ran a second program and received a "Unexpected End of File" error.

That looks like a syntax error in the script. It might be caused by the newer PHP version or maybe by an ini setting.

Nathan10 wrote:These programs were written in prior versions from 2006 or so. I followed the instructions in a book on PHP and MySQL written by Larry Ullman.

Most likely the 2nd edition of "PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide". Otherwise I suggest you get some other information about contemporary PHP and start all over. When you've learned the basics, you may go back to your old code and bring it up-to-date.


@cmb69,

Thank you for your suggestions. That is the book I used. And the "register_globals=off" is the main culprit.

I did a little Internet search on my form problem. I discovered that when 'register_globals=on', the superglobals, $_REQUEST, $_POST, and $_GET, create variables from the field names in the form they are carrying to another page; $userid = $_POST['userid']. Now that register_globals is deprecated, that function no longer exists. My PHP programs were trying to use a deprecated PHP function and so I got slews of errors.

I am still trying to find the better way to carry HTML form data into PHP variables.

Thanks.

Nathan

P.S. I also learned about the security problems of "register_globals=On" that lead to the deprecation of that feature. I had not known about that before.
Nathan10
 
Posts: 5
Joined: 18. February 2015 22:26
Operating System: windows 7

Re: New to XAMPP.

Postby Altrea » 03. March 2015 00:15

Nathan10 wrote:I am still trying to find the better way to carry HTML form data into PHP variables.

very easy. Validate all external data for example with filter_input()
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8286
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 33 guests