Using xampp as a website.

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

Using xampp as a website.

Postby incutonez » 03. April 2010 21:50

Hello all. I wasn't sure if I should post this here or at the php website, but I'm thinking this problem is a combination of both xampp and php. I currently have Apache set up with MYSQL to create a website. It's not running locally because I've tried connecting to the website from school, which it does... but this isn't the problem. What I want to be able to do is allow one of my group members to be able to either have access to my php files in my xampp folder (and be able to edit them) or allowed to connect to the website if they run their own php code from home--I would rather have the latter. I'm just wondering how to do this... I think the main problem is within the mysql_connect statements... I'm just not sure what the hostname should be. On the server computer, it's localhost, but for the group member, would it just be my ip or what?

If any further clarification is needed, please ask. Also, if there's a tutorial out there, please post it. Thank you very much.
incutonez
 
Posts: 6
Joined: 03. April 2010 21:27

Re: Using xampp as a website.

Postby Narrowboyy » 04. April 2010 09:01

You will need to change the Host for your database in phpMyAdmin from "localhost" to "any host".
Narrowboyy
 
Posts: 64
Joined: 16. February 2009 02:56

Re: Using xampp as a website.

Postby incutonez » 04. April 2010 21:11

Ok, I did that, but now I have two root users when I log in with phpmyadmin. One is for the localhost and the other is for any host, is this alright? And when I'm using my php connect statement, do I use "http://ipaddress" or just "ipaddress" for the host name? Also, do I include the port number with it and should I update my windows\system32\drivers\etc\hosts file to show my ip instead of 127.0.0.1? Thanks.
incutonez
 
Posts: 6
Joined: 03. April 2010 21:27

Re: Using xampp as a website.

Postby Narrowboyy » 05. April 2010 01:01

incutonez wrote:Ok, I did that, but now I have two root users when I log in with phpmyadmin. One is for the localhost and the other is for any host, is this alright?

That's OK.

incutonez wrote:And when I'm using my php connect statement, do I use "http://ipaddress" or just "ipaddress" for the host name? Also, do I include the port number with it?

Don't add the http:// bit only use the IP address and the port number if you have changed it from the default port 3306 or use the domain name instead of the IP address, with or without the port number as explained above.

Some useful examples can be found here to help with most of your questions:
http://php.net/manual/en/function.mysql-connect.php

Also there are some comments included re the Windows Host file usage.
(Leave in place as the first entry in the Hosts file 127.0.0.1 localhost
You can disable IPv6 in the Hosts file - ::1 localhost - if required using the xampp_setup.bat file).

Not sure if you need to add your IP to the Hosts file, I have never had the need to add it except for the Apache web server when testing sites locally, in the form:
127.0.0.1 mywebsitename


BTW super user root should not be applied as an individual database user, rather you should define a separate user/pass combo for each individual database you create.

This has an added security advantage in that if an individual user logs into their associated database in phpMyAdmin then that user will see that associated database only.

On the other hand if you assign the super user root to your databases then anyone logging in via phpMyAdmin can see and manipulate all databases in your system - not very secure as you can imagine as only you as the server admin should be the super user root.

If you have problems with all this and you get error messages, then it would help to troubleshoot if you paste the errors here.

I hope this has been of more help for you to be able to move forward.
Narrowboyy
 
Posts: 64
Joined: 16. February 2009 02:56

Re: Using xampp as a website.

Postby incutonez » 07. April 2010 01:40

Yep, my buddy and I got it working. It was a combination of problems... in my my.ini, I added the line "bind-address 0.0.0.0" and had to turn off my firewall, so now it's working. The next problem I'm running in to is on our site we have a forgot password message that can be sent, and he is able to send a forgot password message using his mail server's settings (he has a Mac), but on my side (Windows 7), I can't send the forgot password mail. I do think this is because I don't have a mail server, so I'm trying to use Mercury right now, but this isn't really turning up anything... I think the problem is in MercuryC SMTP Relay because I need a Smart Host Name and that's the problem, I have no host, so are there free programs out there that work/can you walk me through it? I've tried downloading windows live mail and using that, but either I'm doing something wrong or it's a no-go. Also, I've tried just using the hotmail and gmail send servers (mx1.hotmail.com, mx2.hotmail.com, smtp.live.com, then smtp.gmail.com) with my actual email address at hotmail/gmail.com and its password, but that doesn't work either. Any help would be really appreciated. Thanks so far man!
incutonez
 
Posts: 6
Joined: 03. April 2010 21:27

Re: Using xampp as a website.

Postby Narrowboyy » 07. April 2010 03:04

TIP
Please try and break up your posts into line separated paragraphs to make it easier to read - all one paragrapg is very hard on the eyes. :)
Thanks

I take it your password reminder script is PHP and you are using XAMPP 1.7.3?

You need to configure xampp\php\php.ini and \xampp\sendmail.ini.

EDIT
My post was irrelevant as you are not using XAMPP 1.7.3.
It is always preferred to post your XAMPP version and what OS you are using.
Last edited by Narrowboyy on 07. April 2010 03:45, edited 1 time in total.
Narrowboyy
 
Posts: 64
Joined: 16. February 2009 02:56

Re: Using xampp as a website.

Postby incutonez » 07. April 2010 03:24

Haha, man, I feel like a jerk that you actually replied before I could reply that I got it working... I just tried doing what you said anyway and got a port 25 error, but I did kind of go over it fast. What I did was the following:

In php.ini:
Code: Select all
[mail function]
; For Win32 only.
SMTP = smtp.comcast.net
; http://php.net/smtp-port
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = admin@localhost


In sendmail.ini:
Code: Select all
; configuration for fake sendmail
[sendmail]
smtp_server=smtp.comcast.net
smtp_port=25
default_domain=mydomain.com
error_logfile=error.log
debug_logfile=debug.log
auth_username=
auth_password=
pop3_server=
pop3_username=
pop3_password=
force_sender=admin@eauction.com
force_recipient=
hostname=


Because gmail uses TLS, it's kind of tricky, which led me to play around and use my ISP as the smtp_server. Works like a charm. Thanks so much for your help man, I really do appreciate it, even if I am a jerk, haha.
incutonez
 
Posts: 6
Joined: 03. April 2010 21:27

Re: Using xampp as a website.

Postby incutonez » 14. April 2010 02:50

Ok, I feel like I'm back at square one. I went to go start up the server today and it only connects locally. I can't connect using http://(my ip address), which is how I would normally do it. My IP address hasn't changed, and I haven't changed anything to httpd.conf or any other file for that matter.

I tried installing a copy of xampp in another folder and tried setting that up, but can only connect locally. My firewall/Window's firewall is off. The only thing I change to get the server working for outside users is in httpd.conf, right? I change this line:

Code: Select all
ServerName myIPaddress:80


I'm also just trying to connect to a php file that says "it works!"... no database or anything at this point, so there's either something still wrong in Apache or maybe I installed some updates from Windows that xampp doesn't like. I really have no clue. Any help would be appreciated, and if anyone needs further clarification, just ask.

***Also just want to note that all of my ports are being forwarded as well, so I seriously haven't changed anything in xampp, which is why I'm starting to think maybe it's a Windows issue, whether it be a newly installed program or updates.
incutonez
 
Posts: 6
Joined: 03. April 2010 21:27

Re: Using xampp as a website.

Postby incutonez » 14. April 2010 04:49

Yeah so the problem was... apparently my internal IP address changed, so I just switched all of the port forwardings from my old internal IP to the new one. Sometimes I'm really stupid, haha.
incutonez
 
Posts: 6
Joined: 03. April 2010 21:27


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 107 guests