shocm.com

scotch, baseball, open source, and development

PHP Unable to send email from web application .. (but commandline works)

This issue seems to have popped up a couple times over the past couple weeks so I figure I would capture the resolution here in the event someone stumbles onto this post and it's able to help them. Security is rarely convenient and this is an example of that.

Symptom:

CentOS machine running current on patches and running a current version of PHP, let's say PHP 5.3 or higher. PHP script is able to sent email from the command line, but when trying to send an email with PHP through the web browser it fails. Actually it doesn't "fail" it just doesn't seem to ever send.

Resolution:

SELinux is running on the machine and is preventing the Apache process to send out emails. There are a couple approaches you can take for this. To quickly test and confirm that the problem is in fact SELinux, and not something else, you can temporarily disable SELinux.

  • First verify SELinux is running with the command (as root) getenforce
  • Next, if SELinux is running you can disable with the command, again as root, setenforce Permissive

 

SELinux with be disable until you reboot the machine or enable it with setenforce Enforcing. You can permanently disable SELinux is you so desire editing the file /etc/sysconfig/selinux and changing the setting SELINUX=

Test your PHP Mail functionality now from the web application. If it works then you need to have SELinux allow the apache process to send emails. In order to do this, run the commands

  • setsebool -P httpd_can_sendmail 1
  • setsebool -P httpd_can_network_connect 1

 

You should now be able to re-enable SELinux and successfully send emails from your application in the browser.

April 15, 2014 Development, Linux , , ,

PHP Unable to send email from web application .. (but commandline works)

This issue seems to have popped up a couple times over the past couple weeks so I figure I would capture the resolution here in the event someone stumbles onto this post and it’s able to help them. Security is rarely convenient and this is an example of…

This issue seems to have popped up a couple times over the past couple weeks so I figure I would capture the resolution here in the event someone stumbles onto this post and it's able to help them....

Uncategorized

Keeping Vendor Meetings Productive

I spent a good amount of my professional life in meetings. Tons of meetings. When I worked for a Fortune 500 company, I started to think they were paying me just to fill a chair in a conference room. I started jotting down notes on meetings and how to best run them. I recently came across those notes and figured I would just throw them up here in the event they happen to be useful to someone else. Full disclosure, I am a well documented anti-meeting guy. I am not a fan of them and feel that more times than not, they are a waste of time and money. However they are a necessary evil, especially when working for a large organization or with large teams, and if handled correctly can actually become productive. One area where meetings can't be avoided and have a high requirement to be well organized is when meeting with new vendors.

Meeting with a new, or potential new, vendor can be like having to talk to someone you don't know at a friends party. You know you have the friend in common but really don't know much more about one another and yet you need to try and have a conversation with them. I've found following a couple of rules make meetings with vendors a lot more efficient and productive.
Continue reading →

March 16, 2014 General

Since LEGO made movies are all the rage right now, why not make a LEGO movie explain the philosophies…

Since LEGO made movies are all the rage right now, why not make a LEGO movie explain the philosophies behind Open Source. Seems to make sense. 

This is actually not a bad introduction to Open Source for those of us that struggle making it easy and non-technical to understand. 

March 7, 2014 F/OSS, Geek Stuff

My SDPHP Composer Presentation

A little while back I did a lightning talk at one of our SDPHP MeetUps on Composer. Composer is a fantastic tool and one that will change the way you approach PHP development. Using and managing external packages on a per project level has never been so easy in the PHP world.

I kept forgetting to publish my slides so for what it's worth, here they are.

 

March 5, 2014 Development ,

The new PHP – Programming – O’Reilly Media

If your organization has written off PHP from being a possible solution to its development needs, you may want to rethink that decision. PHP is making a strong comeback and with developers who have years of experience under their belt, a language that has matured with the Internet it helps run, and now new features, stronger communities, and interoperability high on everyone's priority list, PHP is once again a great solution for any development need. 

The programming language many love to hate is experiencing a renaissance. This is not your parents' PHP. The new PHP is a more mature language with community standards,...

March 4, 2014 Development

Weather cleared up and was beautiful. Ton of people in good spirit here at Chelsea’s Run #t  

Weather cleared up and was beautiful. Ton of people in good spirit here at Chelsea's Run #t  

March 1, 2014 Family

Weather cleared up and people showed up for Chelsea’s Run #t #chelseasrun

Weather cleared up and people showed up for Chelsea's Run #t #chelseasrun

20140301_072034.jpg

Family

Added photos to SCALE 12x – Southern California Linux Expo.

Added photos to SCALE 12x - Southern California Linux Expo.

February 25, 2014 Uncategorized

Added photos to SCALE 12x – Southern California Linux Expo.

Added photos to SCALE 12x - Southern California Linux Expo.

F/OSS, Geek Stuff, Linux, Uncategorized

Hanging out at #scale12x in Los Angeles today. Conference gets bigger and bigger every year.

Hanging out at #scale12x in Los Angeles today. Conference gets bigger and bigger every year. 

February 22, 2014 F/OSS, Geek Stuff, Linux

#SDPHP  had a last minute change of venue that landed us at #prefabsd which is a new co-working location…

#SDPHP  had a last minute change of venue that landed us at #prefabsd which is a new co-working location in downtown San Diego. Nice space and you can't bet the location. #t  

20140212_203308.jpg

February 13, 2014 Uncategorized

Some useful git alias commands

Just a few useful git aliases I've stumbled upon on the net which I've found useful and use on a pretty regular basis.

November 16, 2013 Development

Git things done

git-logo-cc-by-300x300Been meaning to post this for a while. I've been using Git for a number of years now and my last two jobs had me using it heavily. I love git and honestly have managed to block the memories of what my life was like when I tried to manage my version control life with Subversion.

We've also been discussing Git a lot in our SDPHP Group.  I am not going to get into a long post about the coolness of Git and why you should be using it, that is kind of an old discussion at this point. If you are not using Git nowadays I will assume you (a) Don't want to use Git, (b) Don't have a good enough understanding of Git, (c) Don't know what Git is. If you are in category (c) you are probably not a developer and this will be of no interest to you. If you are in category (a), well then I am sure you have your reasons and they are valid. If you are in category (b) then let me share a few things with you. First are some links to some great resources on how to use Git. These groups know what they are talking about and do a fantastic job explaining things, way better than I could ever do.

Helpful links

I also have a couple of presentations I can share with you. The first one was by John Congdon (@johncongdon) and was presented to the SDPHP Group at our monthly meetup Downtown back on Sept 11

I also did a smaller presentation to the SDPHP Study Group earlier on Aug 26

I hope you find some of this information helpful and/or useful.

September 28, 2013 Development, Geek Stuff

#phpdrama

Man, it seems like a week can't go by without some sort of drama in the PHP Community. I never thought I would be so close to one of the issues but yeah it was that sort of slow news week I guess. So this is my rant of the issue.

Let me prefix this post with some obvious disclosures, I am one of the organizers of the San Diego PHP User Group. I put a good amount of effort in the running of the group and take a tremendous amount of pride in what I do. With that said, the amount of work I do and pride I have in SDPHP pales in comparison to that of the head organizer, and friend John Congdon.

What Happened?
We had a member do presentation on Laravel 4. He did a great job. We had a great turn out, one of our larger turn outs, and there were a lot of questions, good general discussion. Really nothing out of the ordinary for a user group. Immediately after the meeting the praises started on how well the presenter did including post to our social streams, again not out of the ordinary. Speaking with the presenter you could tell he was a little disappointed that he might not have been able to answer all the questions thrown his way to his satisfaction. Anyone who has done public speaking or a presentation on topics know the feeling of being asked a question that you might not have an answer for.

Let's take a step back here, our group has some core members who stay very involved. We've built up friendship, helped each other find work, find solutions to problems, and find a good place to have a beer. We are on an IRC channel all day and will typically speak to each other everyday. Anyone is welcome to be part of this core and typically people will come and go. Like all tight groups, we will push each others buttons and joke with each other. We do it all in fun and when one of us crosses a line it is typically addressed pretty quickly and resolved. This particular situation probably would not have been any different except that it involved people outside our little group and became more public.

What The Hell Happened?
The presenter decided to follow up with the creator of Laravel 4, Taylor Otwell. I don't personally know Taylor but there are a couple of people in our group who do and from everything I've ever heard, he is a top notch guy and needless to say very well respected in the PHP Community. He is very accessible and helpful. This is where things start to go bad. Maybe out of frustration or just poor perspective but the presenter started to complain to Taylor about the group and how he was treated, feeling that he was being heckled. For the recorded that couldn't be further from the truth, he wasn't heckled and everyone was very respectful towards him. At this point everything is being contained in private IM chats between the presenter and Taylor.

Taylor starts to generalize and make some very negative statements about the group as a whole which were unjust but based mainly on the perspective of the what he is being told by the presenter. Whether Taylor felt he was just consulting a battered friend or if he honestly started to develop ill feelings towards the group wouldn't really matter, it would have all actually ended there in that IM window between two people.

SO WHAT THE F*@&K HAPPENED?
Here is where things go off the tracks. The presenter then turns around and post screenshots of the IM chat to the SDPHP groups public IRC channel. Now we have a problem, and that conversation just became the business of everyone in the room. I personally addressed it publicly in the channel at the time.

So this next chunk is from the IRC Chat that followed after I saw the post of the IM conversation with Taylor.

[11:48am] shocm: CA***: WTF? Dude really? going to slam the group like that
[11:48am] CA***: ha
[11:48am] CA***: well
[11:48am] CA***: look man
[11:48am] CA***: i was asking
[11:49am] CA***: but the q's were kinda douchey
[11:49am] CA***: if you know its an intro
[11:49am] shocm: I'm calling Bullshit
[11:49am] a**: dude..... all of my questions were legit questions
[11:49am] CA***: ok
[11:49am] CA***: i was ill prepared
[11:49am] shocm: they were normal questions dude
[11:49am] shocm: You were fine
[11:49am] shocm: but don't slam the group if you feel like you couldn't answer something
[11:49am] shocm: its not an issue unless you make it an issue
[11:50am] shocm: No one cared you didn't know
[11:50am] shocm: But they were normal questions
[11:50am] CA***: i was actually asking
[11:50am] ka**: shocm I know, right?
[11:50am] shocm: No i don't think you were ill prepared. I think you were fine.
[11:51am] shocm: And you preference it with "Hey I am new to this and this is what I know"
[11:51am] CA***: http://cl.ly/image/3q2v3s031A0e
[11:51am] EchoBot: [ http://is.gd/pUjskG ] Screen Shot 2013-08-15 at 11.51.02 AM.pn...
[11:51am] shocm: we do that all the itme
[11:51am] wr**: Ya for an intro it was perfect
[11:51am] shocm: and the group is cool with it
[11:51am] CA***: now
[11:51am] shocm: but they don't know what you don't know so they ask questions
[11:51am] CA***: the elitism that i felt was what i felt w/ some of the Q's
[11:52am] CA***: perhaps i mis conciened that
[11:52am] CA***: but the point of the screens wads to show that hey
[11:52am] CA***: I am looking into the Q's
[11:52am] CA***: from the source
[11:52am] CA***: the framework is still cool
[11:52am] CA***: and so is TO
[11:53am] CA***: and the group for that matter
[11:53am] ka**: <3
[11:53am] a**: The questions i asked were questions that would allow people, who use other frameworks, to more easily integrate with this framework. I didnt bring up the fact that i didnt like facades in the actual presentation.
[11:53am] shocm: Look, I am cool with us in the group give each other a hard time in fun, and I think we do a lot of that, but representing the group as a whole in a bad light is a crap move.
CA***: i mean shit
[11:53am] CA***: well
[11:53am] CA***: I don't think I did that
[11:53am] CA***: but
[11:54am] CA***: I will share the video w/ him
[11:54am] CA***: and everyone for that matter
[11:54am] CA***: and we can all have our opinions
[11:55am] ka**: nice, I want a watch
[11:55am] CA***: yea
[11:55am] ka**: the whole presentation?
[11:55am] CA***: yea
[11:55am] ka**: sweet
[11:55am] CA***: perhaps sharing my convos was a bad move
[11:55am] CA***: i wanted to show that hey i am looking into it
[11:55am] CA***: but hey
[11:55am] CA***: it is what it is
[11:56am] a**: the direction your convo went with him was the issue
[11:56am] CA***: true
[11:56am] CA***: the chump comment was directed directly at you

I am not sure what the purpose of posting the IM conversation to the group IRC was. The presenter claims he was showing that he was following up on the questions but the discussion he posted was a back and forth with Taylor slamming the group. So now there are a lot of people offended by this when John gets online and catches wind of what is being discussed.

John has a ton of respect for the PHP Community and especially the leaders who help make up the PHP Community and he reaches out to them on Twitter. This is where the topic got a little more exposure and Taylor starts to learn a conversation he thought was private was publicly shared and discussion sparked up on Twitter on what was said. Chris Hartjes starts to address the issue. If you are not familiar with Chris, he's sort of an "in your face" guy who has been known to be a little abrasive but is someones opinion who I personally hold in high regard. He is brutally honest, with an emphasis on honest (and shit for that matter brutal).

Here are some of the threads from twitter

Taylor mentions in some of the conversations on twitter that he never even knew what group he was speaking towards and I think that he feels there is a general assumption that he was referring to the act in general, but he wasn't. He made negative remarks and generalized a group based on little information he had and as a leader in the community you simply can't do that because people take that shit to heart. Especially people like John and myself who feel like we work pretty hard to better the PHP Community by running groups like SDPHP. It sucks your private conversation was made public and I can appreciate. The presenter shouldn't have shared the chat, there is no question there, but at the same time he was having a conversation with someone he respected very much and that person was agreeing with him, so why wouldn't he share it?

The PHP community is very passionate and I think this only goes to show how quickly lines can get drawn over the most mundane topics at times. I am personally happy we have people like Taylor Otwell, Chris Hartjes, and John Congdon making PHP and the PHP Community stronger. They are held to a higher standard and should know the impact of their opinions and discussions to the group at large.

Really, that's it? Why did you waste my time?
I told you this was my rant, why are you still reading this anyways? For the record, the presenter did apologize for his involvement. Acknowledges it was a bad idea to share that conversation and that maybe his perception on the events was not a good representation of what actually happened. With that said, I truly hope this matter is done, that we haven't lost a member of the group and that we can all move on. I think I have, at least that is what I will say to wrap this up because it seems like the appropriate thing to say and I do feel better now.

If you are interested in more perspective on this:
John also did a Blog Post on his personal blog if you are interested to continue reading about this.

** FOLLOW UP - August 17, 2013**
Figure I would add this here instead of creating a new post. So it was a very eventful 24 or so hours. I won't bother to rehash but to say we had people step up and show us support, people step us and let us know how wrong they felt we were, and people step up and help us resolve the issue.

There are so many "for the record" statements I would like to make here but it really doesn't matter at this point. Everything we discussed is public. Bottom line, at the end of the day we got an opportunity to show Taylor Otwell that we are a group of passionate PHP developers. Taylor took the time out of his day to join our IRC channel and discuss any follow-up questions the group had about Laravel. He was very accommodating and even shared some insight.

I am very happy and appreciative that Taylor took the time to speak with us. As I've already told Taylor, our door is always open whenever he wants to drop by.

August 16, 2013 Rant
  • Archives