Jump to content

bobspar

Members
  • Posts

    10
  • Joined

  • Last visited

bobspar's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi Guys, Postgres not available from CPanel. User name bobspar1... Perhaps there is a place to see scheduled maintenance, or current issues, I don't know where to look for that, so not sure if its just my CPanel or maintenance. Thanks Bob
  2. Just out of curiosity, I had a look at that Async code... that is pretty much the async PHP kludge... but it will make Java and C++ programmers cringe... Creating a connection and then bombing the thing closed... well who knows what will happen. Anyway I mention it because PHP does actually have Async sockets... $s = stream_socket_client("tcp://".$host.":".$ports[$id], $errno, $errstr, $timeout, STREAM_CLIENT_ASYNC_CONNECT|STREAM_CLIENT_CONNECT); Looks like that... and one does not have to crash the connection. It works... its not a thread... its spawning a process... and unlike C++ languages there is no feed back as to whether it worked. Well it depends how one looks at it... a PHP coder will say... clever stuff, I get my Async stuff working... but Java and C++ coders will think its the worst abomination they have ever seen, like smashing a screw in with a hammer Its all bad coding actually... a weakness in PHP... but then that's because PHP was designed to make calls into the server completely isolated from each other. In Java one can peek at what is happening in another call... PHP that's difficult as well, but probably good. Its strength is also its weakness.
  3. OK... don't worry for now, I managed to find a kludge... I put a primitive PHP web service on another server, and I call it with a POST from this server... it works but its not a great solution. But enough for the boss man to now play with the thing At some stage I'll find a better solution... Java Servlets are damn good at doing this... web pages return immediately... maybe later. Now I just hope the boss man likes it... then there will be some work for all of us, hopefully... it will have to be moved to a production server, security and all that good stuff, and I now know you guys will be good at that. I'll chat more when the time comes. Thanks... if you ever want the code for that Emailing Java Servlet... I can dig it out of the archives... just a web service.. Receives a post, starts a background thread, return to caller and then tries to send the email up to 3 times... simple thing, but it makes the user experience nice. The PHP trick would require turning on a few things... but its not using threads, its actually launching a new process, not the best way. Later... thanks again... Bob Actually just to make this thread a little more useful to PHP guys, here is what the code looks like that calls my little web service... no email stuff in your program... but of course the web service must be there... just so you can see what I been waffling on about... its a POST from the code. function do_post_request($url, $data, $optional_headers = null) { $params = array('http' => array( 'method' => 'POST', 'content' => $data )); if ($optional_headers!== null) { $params['http']['header'] = $optional_headers; } $ctx = stream_context_create($params); $fp = @fopen($url, 'rb', false, $ctx); if (!$fp) { throw new Exception("Problem with $url, $php_errormsg"); } $response = @stream_get_contents($fp); if ($response === false) { throw new Exception("Problem reading data from $url, $php_errormsg"); } return $response; }; //Using this as a kludge because mailing does not work... //I use a remote PHP mail server... its a kludge function sendMailRemote($tomailIN, $nameIN, $subjectIN,$htmlinfoIN,$textinfoIN) { $url = "http://TheMailWeService"; $tomail = urlencode($tomailIN); $name = urlencode($nameIN); $subject = urlencode($subjectIN); $htmlinfo = urlencode($htmlinfoIN); $textinfo = urlencode($textinfoIN); //$tomail = urlencode("Dude@gmail.com"); //$name = urlencode("Your Remote Ness"); //$subject = urlencode("Test Post Mail"); //$htmlinfo = urlencode("Some HTML"); //$textinfo = urlencode("Some Text"); $data = "tomail=".$tomail."&name=".$name."&subject=".$subject."&htmlinfo=".$htmlinfo."&textinfo=".$textinfo; if(do_post_request($url, $data)){ return true; }else{ return false; } };
  4. Hi Krydos, I have been out of software development for about 7 years... I thought, well I'll just go to the Google API engine and make a mail web service, man! the internet has changed, no longer do they say "hey developers, come make a web service", now its one gigantic "click and pay" shopping center. Cant say I like this new internet much. Developers seem to have been forgotten now that these large organizations own the world. Consolidation I think they call it in business, no fun for developers is what it feels like. I think you right, the easiest way to get this test system up is going to be your PEAR idea... just have a few questions. 1) I'm testing on Johnny and I don't see the PEAR module? 2) Why will Pear be able to SMTP emails, but a PHP library cant, is that just policy, or some technical limitation, just curious. 3) Does PEAR do the email as a background task, or does the browser "freeze" while the email goes? 4) Finally if Tomcat is able to send SMTP requests, and if you want, I could make a background mailer specifically for registration confirmation. Its just that Java has great threading and so the PHP code, or any other code returns immediately from the simple Post. We could put a 10 line limit on emails or something like that to make it specifically for tiny emails, no pics, no attachments... no spam, and they going through their own mail provider, so no disk space, but you would have to enable SMTP for the war app on tomcat? That code will be handy later for other projects. Mailing from web apps is much more of a mission than I expected... if I get the PEAR thing going, I will probably settle for that for the test site, but if she cant send in the background, I'll have to make something better later. There is a trick in PHP to simulate background tasks using Async Sockets... but for some reason they don't seem to fire up on Johnnies PHP, probably some setting somewhere. So PHP can be made to do this stuff, but it seems security measures get in the way. It seems that a little web service may be the way to go... on Java Tomcat. Anyway, if you can just show me how to get Pear installed on Johnny, I'll give it a go...If SMTP will work on Tomcat... I can go that route as well... and that is something everyone on the site can use... POST, done... Thanks for your help... Bob
  5. Thanks... it seems to be working now... this PHPMailer 5.2.8 lib is not bad... Yeah, the standard PHP mail engine sucks for want of a better word... thus I'm using the PHPMailer third party lib... seems to work OK. But yes, this exercise has got me thinking... I think my next move will be to tie into the Google or Yahoo clouds and just send HTTP requests to the those huge engines... I think the email will be instantaneous... probably not free, don't know yet. But yes... PHP is a damn good scripting language but its weak in Email and in background tasks... agreed, anything else is better in that area So far I have been able to make the site without tying into PHP addons... trying to stay there if I can. You guys have an amazing array of tools, I doubt whether other hosting services come close to your software stack. In the main... I just like KISS... Well, I think I almost have this test site up on Heliohost... good on you guys Thanks[/size]
  6. Hello Clever People... I have a Helio Email account which works perfectly as a normal email account. I have a PHP client that send registration confirmation in the site. It seems to work... but nothing comes out the other side... I list the test output for you below of SMTP conversation between client and server... There seems to be no problem.. other than possibly this client is PHPMailer 5.2.8 and the mail server doesn't like it perhaps... it doesn't complain... but it also never sends the message... I don't think its specific to the SMTP on the server, because even if I do it from my server... goes OK, but also never comes... so I suspect its a spam filter active of some kind... or I just cant use CPanel properly yet and I have to set something. This is strictly for confirming registrations, will never be used for anything else. Thanks Bob[/size][/size] -------------[/size] CLIENT -> SERVER: EHLO diybookmaker.heliohost.org SERVER -> CLIENT: 250-johnny.heliohost.org Hello johnny.heliohost.org [64.62.211.131]250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN250 HELP CLIENT -> SERVER: AUTH LOGIN SERVER -> CLIENT: 334 VXNlcm5hbWU6 CLIENT -> SERVER: aW5mb0BkaXlib29rbWFrZXIuaGVsaW9ob3N0Lm9yZw== SERVER -> CLIENT: 334 UGFzc3dvcmQ6 CLIENT -> SERVER: ZGFwYXNzNE1Fbm90VQ== SERVER -> CLIENT: 235 Authentication succeeded CLIENT -> SERVER: MAIL FROM:<info@diybookmaker.heliohost.org> SERVER -> CLIENT: 250 OK CLIENT -> SERVER: RCPT TO:<diybookie@yahoo.com> SERVER -> CLIENT: 250 Accepted CLIENT -> SERVER: DATA SERVER -> CLIENT: 354 Enter message, ending with "." on a line by itself CLIENT -> SERVER: Date: Sat, 8 Jul 2017 17:23:11 +0000 CLIENT -> SERVER: To: Mr Test <diybookie@yahoo.com> CLIENT -> SERVER: From: Do Not Reply <info@diybookmaker.heliohost.org> CLIENT -> SERVER: Reply-To: Do Not Reply <info@diybookmaker.heliohost.org> CLIENT -> SERVER: Subject: Mail Test CLIENT -> SERVER: Message-ID: <a960fb135cf51709541bc2cc3a158e95@diybookmaker.heliohost.org> CLIENT -> SERVER: X-Priority: 3 CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.8 (https://github.com/PHPMailer/PHPMailer/) CLIENT -> SERVER: MIME-Version: 1.0 CLIENT -> SERVER: Content-Type: multipart/alternative; CLIENT -> SERVER: boundary="b1_a960fb135cf51709541bc2cc3a158e95" CLIENT -> SERVER: Content-Transfer-Encoding: 8bit CLIENT -> SERVER: CLIENT -> SERVER: --b1_a960fb135cf51709541bc2cc3a158e95 CLIENT -> SERVER: Content-Type: text/plain; charset=us-ascii CLIENT -> SERVER: CLIENT -> SERVER: Some Info CLIENT -> SERVER: CLIENT -> SERVER: CLIENT -> SERVER: --b1_a960fb135cf51709541bc2cc3a158e95 CLIENT -> SERVER: Content-Type: text/html; charset=us-ascii CLIENT -> SERVER: CLIENT -> SERVER: Some Html Info CLIENT -> SERVER: CLIENT -> SERVER: CLIENT -> SERVER: CLIENT -> SERVER: --b1_a960fb135cf51709541bc2cc3a158e95-- CLIENT -> SERVER: CLIENT -> SERVER: . SERVER -> CLIENT: 250 OK id=1dTtRo-0007kc-6D CLIENT -> SERVER: QUIT SERVER -> CLIENT: 221 johnny.heliohost.org closing connection[/size] Ah... I see it now... its now putting this at the top... /home/bobspar1/public_html/go/php/libsSERVER -> CLIENT: 220-johnny.heliohost.org ESMTP Exim 4.88 #1 Sat, 08 Jul 2017 10:47:27 -0700 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail. Question them becomes... how does one do Email confirmations of registration... I can use an external mail server, but then SMTP will reject me... please advise, thanks. Ah... I see it now... its now putting this at the top... /home/bobspar1/public_html/go/php/libsSERVER -> CLIENT: 220-johnny.heliohost.org ESMTP Exim 4.88 #1 Sat, 08 Jul 2017 10:47:27 -0700 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail. Question them becomes... how does one do Email confirmations of registration... I can use an external mail server, but then SMTP will reject me... please advise, thanks.
  7. OK, don't worry I'm using your email accounts... but perhaps you might want to talk about 3rd party emails, if possible. Thanks Bob Ah thanks... yes perhaps later when we get a proper domain name. I know when I tried to setup Debian to send to outside email providers, that its complicated because they have all become paranoid and don't like the idea because of spammers and hackers. So I used yours... it works thanks...
  8. Hello Clever People, I got to say that I am pleasantly surprised with Heliohost... I almost have my test site working, just a few little things left to fix. When a person registers on my site, the site sends a little No Reply confirmation message to the new user. Typical web site stuff. I'm using a Yahoo mail to send the message, not the same as my CPanel log in email address. The SMTP connection on the server is being refused. I see in CPanel a ton of options, but I think that is for people that want to use your server as a email host. Perhaps is better to let Yahoo take the traffic... So how do I do this, do I need to create an email account and use that, or can I just enable the existing email address. That's all this email address does, send confirmations... low traffic. Not sure how you would like me to do it? The email address is diybookie(AT Sign)yahoo.com if you need it. Thanks Bob
  9. Hi Krydos, Thanks man you helped me figure out what is going on and probably only you can get to the main issue... but I got it working, well you did. When I was setting up the dB's, I had a terrible internet connection and I made a dB called ... bobspar1_diybook (The Phantom DB) This dB does not show up in the CPanel... but if I try make it again, it tells me that it exists... So I gave up and made another dB called... bobspar1_diydb (THE ACTUAL DB THAT I SET UP) Then I forgot that I had to do this... and used the PHANTOM DB name ie bobspar1_diybook Of course the thing connects but there is nothing inside bobspar1_diybook and I cant even control it from the CPanel. Its like it got created but the internet bombed and it did not finish... so its a dB stuck in limbo with no permissions and that is causing all the problems. SO... you can delete bobspar1_diybook because I have no control over the thing and it causes these other problems. But do not delete bobspar1_diydb... that's the one that works. Anyway, yeah, our gut feels were right... its a Phantom DB that is causing the issues... its there but its near invisible... you can kill it. Thanks... yeah when I got past the first error I thought, damn all my data has disappeared, the schema is not even there... then I saw the different name in the CPanel... what really snookered me is the things actually connects as well... Perhaps that explains the weird behavior... Thanks... Bob
  10. Hello clever people, Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "::1", user "bobspar1", database "bobspar1_diybook", SSL off in.... If I remember correctly it’s a domain check in Postgres... pg_hba.conf http://diybookmaker.heliohost.org Is what I’m trying to use. I’m day 1 new to Heliohost, perhaps there is a way to set this up myself from CPanel but it eludes me... Thanks Bob
×
×
  • Create New...