Migrating xampp website, but php form doesn't send email from new server
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Migrating xampp website, but php form doesn't send email from new server
Hi everybody. I've been working on migrating a current dying server running a website in xampp to a new server in a modern version of xampp. I think i'm almost there, but I'm having a problem with a .php webpage that's a form that (when working) emails the form data to someone.
The form displays ok, but for some reason the email doesn't send when I hit the submit button. Comparing to the dying server that still works, I don't see anything in /var/log/maillog on the new server like I do on the dying one, so I'm guessing it's not trying to send.
I know sendmail is working, because i can manually send an email via the command line.
But does anyone have a clue where I should look as to why from here? and sorry, I know this is a real vague question.
I've been working on migrating a current dying server running a website in xampp to a new server in a modern version of xampp.
Well, sorry to say but that's where you've gone wrong in the first place. As I've been saying for years, as the XAMPP documentation (which now seems to be tucked away so you'll only find it when you're really looking for it) has been saying for years XAMPP is not intended for use in Production Environments: see Is XAMPP production ready? *XAMPP is a "convenience" suite of software solely for development use, and then only for those that can't be (bothered to) learn how to set up LAMP properly. With all due respect people who can't be (bothered to) set up Apache, MySQL and PHP properly shouldn't be let near any public-facing server in the first place.
Quote:
Originally Posted by rjo98
does anyone have a clue where I should look as to why from here?
Not where but who: if you're not a coder chances are you don't know safe coding standards. (Last time I looked your profile didn't read "PHP coder".) That said start by comparing the new environment (which I sure hope is on an isolated Staging machine and not in Production yet) with the old in terms of daemon configuration (including includes), users, file and directory access rights and phpinfo(). Note that there may be huge differences between deprecated and current PHP versions.
If that's not it craft a simple temporary mail form yourself that's been known to work and test with that.
If that's not it check if adding
Thanks unSpawn. Yeah, definitely not a PHP coder, and no clue why they went with xampp to begin with (probably due to your too lazy to configure it properly), but they requested it in xampp again (I think because they think a .tgz backup of the entire thing is so easy).
And honestly, I've never really set up a web server before in general but i'm trying to learn. I did already create a php form I copied from a php tutorial to simply enter a few fields and send an email, but that didn't do anything either. Also, the existing form does work on the old server.
Hmmm. If you're "just a grunt" you could suggest they should not use XAMPP. On the other hand if you're hosting their web site you have a responsibility and you should tell them. After all then its your server that will be abused, IP address that will get a bad reputation or be blacklisted, your time that will be wasted mopping up...
Added that bit of php code to the test form I had, don't see any errors on the webpage itself, it acted like it worked, but didn't get any email. I hate xampp haha.
unSpawn, or anyone reading this, is there a good tutorial out there I can follow step by step to try to set this up in a "legit" way (not using xampp)? I'd love to give it a shot since xampp gets no love.
Does this sound about right to you guys? Then i just need to figure out where to put the .htm and .php files from the current site onto the new server, and I might be in good shape since sendmail is already working?
I know, kinda going off topic here, but i think this is the right way.
I'm already loading up a base CentOS 6.5 in vbox, so at least I was on the right track before you posted :-)
Thanks for all those links! I'm going to give this a go. I'll post back if/when I run into any problems, or if I successfully do this on my own (fingers crossed).
Also, I asked and they said if there are any databases on there, their so old I don't have to worry about them. So maybe I don't even need MySQL installed, idk.
Thanks guys. I got my base CentOS installed, its updating now. Then i'll do my basic configs/tweaks, then see if I can get Apache, MySQL and PHP installed and at least displaying some pages. Here we go...
Thanks. I'm really trying to figure this out here. Have a quick question about php though. When I look at the current server and do a
rpm -qa |grep php-
php-4.3.9-3.36
php-ldap-4.3.9-3.36
php-odbc-4.3.9-3.36
php-mysql-4.3.9-3.36
php-pear-4.3.9-3.36
that's what I get. But does that necessarily mean those are things I need since before that was all in xampp, and now i'm trying to do it sans xampp? really I think the only php on this site is in forms to send emails, so i'm thinking maybe I give it a go with just php and not all the php-extras (also going under the impression I can skip MySQL).
Quick update. Got the base server where I needed it (mostly, didn't go too crazy cuz I didn't want to leave you guys hanging), installed apache and php, made a test php info file (stole idea from that link I posted) and a test mail form php file in /var/www/html, the php info file displays php info, and the mail form when I submit I see some action in /var/log/maillog. I didn't get the email, but maybe I have to configure something differently for it to work through the vm through my machine to the mail relay, but the fact that it's actually doing something in the log is a positive sign!
Now I need to figure out how to undo all the xampp stuff on my real replacement server, then go this route. Reading online it looks like supposedly all I need to do is a rm -rf /opt/lamp.
Actually, this is way easier than trying to get xampp going to. And here everyone told me xampp made things easier...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.