ideo / stanley-bot

Stanley is a custom SMS messaging platform to prototype early services, products, and content
Other
134 stars 17 forks source link

Having trouble installing database #1

Open rcrusoe opened 8 years ago

rcrusoe commented 8 years ago

Loved your Medium post and was very excited to give stanley-bot a try, but I'm running into some issues. I made it as far as step 6. I have successfully signed into sequel pro using my clearDB login credentials, but (a) no database data is shown and (b) I'm not sure how to go about installing the database now. I have next to zero php experience, so this is likely just a knowledge gap. Help would be appreciated!

davidboardman commented 8 years ago

Hey Robinson. Thanks for the message. I added more details in the steps 6-10. If you have a herokuapp, you should be able to install the database by running http://YOUR_ HEROKU_INSTANCE/config/installDB.php

You can also do it manually:

DROP TABLE IF EXISTS ".$dbTable."; CREATE TABLE ".$dbTable." ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, phonenumber varchar(50) DEFAULT NULL, smsid varchar(255) NOT NULL DEFAULT '', flagread varchar(11) DEFAULT '', label varchar(255) DEFAULT '', active varchar(11) DEFAULT '', PRIMARY KEY (id) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Hope this helps.

David

rcrusoe commented 8 years ago

Hi David,

Really appreciate the help. I am still running into an issue (and again - this is likely due to my inexperience with php).

By "run" do you mean visiting http://YOUR_ HEROKU_INSTANCE/config/installDB.php in the browser? i.e. http://example.herokuapp.com/config/installDB.php

When I attempted that, I caught a fatal error in the heroku logs: 2016-09-27T15:44:23.544960+00:00 app[web.1]: [27-Sep-2016 11:44:23 America/New_York] PHP Fatal error: Uncaught Services_Twilio_RestException: Could not decode response body as JSON. This likely indicates a 500 server error in /app/includes/Twilio.php:287

Thanks again! Robinson

davidboardman commented 8 years ago

Try commenting out rows from 51 to 59 in config.php

/* $http = new Services_Twilio_TinyHttp( 'https://api.twilio.com', array('curlopts' => array( CURLOPT_SSL_VERIFYPEER => true, CURLOPT_SSL_VERIFYHOST => 2 )));

$client = new Services_Twilio($accountSid, $authToken, "2010-04-01", $http); */

kertwang commented 8 years ago

Hey doods - not a developer here but changing mysql_num_rows to mysqli_num_rows in row8 of instalDB.php did the trick.

colepreece commented 7 years ago

Hey @davidboardman I'm trying to implement this, and I'm having trouble running the script to install the database. I ran the script http://YOUR_ HEROKU_INSTANCE/config/installDB.php and it didn't create a database table (that I could see in Sequel) but I looked at the Heroku logs and I'm not getting any errors. I also tried doing it manually as you suggested, and commenting out rows 51-59, and commenting out the if statement in installDB.php. Before running installDB.php in the browser, when I sent a message to our Twilio number, I got a Warning (12200) in Twilio for a schema validation warning. After entering the script in my browser and going to it, I get a HTTP retrieval error (11200) in Twilio when sending a message. Thank you so much for your help!

davidboardman commented 7 years ago

hey cole. it seems like a similar issue as the one described above. try having a look to the previous comments.

bubbaJackson commented 7 years ago

Anyone solved this? I've tried both the suggestions above and nothing works

cbalmes2 commented 7 years ago

@davidboardman Thanks for creating this and the readme. For some reason, I cannot open the installDB.php file on my heroku instance. I keep getting "could not open input file" followed by the address I put in, which follows your pattern above. I did a manual deploy within the Heroku dashboard to ensure all the follows were copied from my git repo into the Heroku instance.

Any thoughts, tips, or tricks?