Help Needed in handling Forms (GAE PHP)

265 views
Skip to first unread message

Anmol Parashar

unread,
Oct 2, 2014, 7:34:31 AM10/2/14
to google-a...@googlegroups.com

I'm trying to set up my new website using Google App Engine (PHP). I have bought the domain and my website is working fine. Well, kind of. I have two forms on my website, one asks for just an email and other a contact form. Both of them accepts input but can't send the input to where they are supposed to. A message is displayed, "PHP scripts/files are either not configured properly or are missing. Contact your host."

Here's the thing,

I made my website using Adobe Muse and their forms uses PHP. I have provided all my static html files to Google App Engine (which I'm using as a host) using the Deploy function but whenever I hit deploy, most of the files are read and uploaded except the 8 .php files. The error says, "Mimetype can't be recognized for *.php. Using application octet stream instead."

How do I upload my .php files? (What to write in my app.yaml)

I can use the script: operative for lets say index.php but that page only requires two more php files to run the form and we can't use script: 3 times for a single page.

If you have any knowledge of HTML or HTML5, can you tell me how to make a form that doesn't use PHP?

I'm not using a database. The only thing the form has to do is to send the input to an email.

My website is Subscriber Shop.

My app.yaml currently,

application: sub
version: 1
runtime: php
api_version: 1
threadsafe: yes

handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico

- url: /
static_files: static_website/index.html
upload: static_website/index.html

- url: /index.html
static_files: static_website/index.html
upload: static_website/index.html

#specific html pages:
- url: /about-us.html
static_files: static_website/about-us.html
upload: static_website/about-us.html

- url: /faqs.html
static_files: static_website/faqs.html
upload: static_website/faqs.html

- url: /drop-a-word.html
static_files: static_website/drop-a-word.html
upload: static_website/drop-a-word.html

- url: /unsubscribe
script: static_website/jl3sxnhv7vv.php

- url: /css
static_dir: static_website/css

- url: /images
static_dir: static_website/images

- url: /scripts
static_dir: static_website/scripts

- url: /phone
static_dir: static_website/phone

- url: /.*
static_files: static_website/what-what.html 
upload: static_website/what-what.html

inbound_services:
- mail
- xmpp_subscribe


My index page, contact page and another are supposed to have these 3 forms and they use a total of 8 .php files that are in static_website/scripts

Can anyone please help?

 PS: The support at Adobe Muse says that PHP is not configured. Contact the server admin. How do I tell Google To enable php?

Vinny P

unread,
Oct 2, 2014, 5:57:39 PM10/2/14
to google-a...@googlegroups.com
On Thu, Oct 2, 2014 at 6:34 AM, Anmol Parashar <4nm...@gmail.com> wrote:

I have two forms on my website, one asks for just an email and other a contact form. Both of them accepts input but can't send the input to where they are supposed to. A message is displayed, "PHP scripts/files are either not configured properly or are missing. Contact your host."

I made my website using Adobe Muse and their forms uses PHP. I have provided all my static html files to Google App Engine (which I'm using as a host) using the Deploy function but whenever I hit deploy, most of the files are read and uploaded except the 8 .php files. The error says, "Mimetype can't be recognized for *.php. Using application octet stream instead."

How do I upload my .php files?


 
 
 
Are you deploying within Adobe Muse, or deploying using the App Engine SDK outside of Muse? If you're attempting to deploy while inside of Muse, try this: open your project in Muse, then go to File > Export HTML and save a copy of your website on your local disk. Then download and install the App Engine PHP SDK ( https://cloud.google.com/appengine/downloads ) and use it to upload your local website copy to App Engine. Here are uploading directions: https://cloud.google.com/appengine/docs/php/gettingstarted/uploading
 
 
On Thu, Oct 2, 2014 at 6:34 AM, Anmol Parashar <4nm...@gmail.com> wrote:

- url: /unsubscribe
script: static_website/jl3sxnhv7vv.php


 
 
I see that your PHP scripts are in your static files directory. You need to move them into their own directory or put them at root.
 
 
On Thu, Oct 2, 2014 at 6:34 AM, Anmol Parashar <4nm...@gmail.com> wrote:

 PS: The support at Adobe Muse says that PHP is not configured. Contact the server admin. How do I tell Google To enable php?

 
 
PHP is already configured in App Engine, you don't need to do anything special.
 
 
-----------------
-Vinny P
Technology & Media Consultant
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com
 

Anmol Parashar

unread,
Oct 3, 2014, 7:05:05 AM10/3/14
to google-a...@googlegroups.com
I have done everything. From exporting the files to uploading them on the App Engine. The only thing I can't figure out is how to upload the 8 .php files. I moved them to a different folder but the upload: directive didn't work. Can you please give me exact commands to write in my app.yaml for putting them in the root?

Anmol Parashar

unread,
Oct 3, 2014, 8:21:33 AM10/3/14
to google-a...@googlegroups.com

 
 
On Thu, Oct 2, 2014 at 6:34 AM, Anmol Parashar <4nm...@gmail.com> wrote:

- url: /unsubscribe
script: static_website/jl3sxnhv7vv.php


 
 
I see that your PHP scripts are in your static files directory. You need to move them into their own directory or put them at root.
 
 

 I tried to put the php scripts in the root folder and changed my app.yaml to

application: subscribershop

version: 1
runtime: php
api_version: 1
threadsafe: yes

handlers:
- url: /favicon\.ico
  static_files: favicon.ico
  upload: favicon\.ico

#root
- url: /
  script: static_website/php

#serve our home page in case index.html is requested

- url: /index.html
  static_files: static_website/index.html
  upload: static_website/index.html


Now when I tried to Browse the app using my localhost, it gives me an error and says,


Warning: require(G:\Anmol\subscribershop\static_website\php): failed to open stream: Permission denied in C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\php\setup.php on line 106

Fatal error: require(): Failed opening required 'G:\Anmol\subscribershop\static_website\php' (include_path='G:\Anmol\subscribershop;C:\Program Files (x86)\Google\google_appengine\php\sdk') in C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\php\setup.php on line 106
 

Vinny P

unread,
Oct 6, 2014, 3:43:33 PM10/6/14
to google-a...@googlegroups.com
On Fri, Oct 3, 2014 at 6:05 AM, Anmol Parashar <4nm...@gmail.com> wrote:
I have done everything. From exporting the files to uploading them on the App Engine. The only thing I can't figure out is how to upload the 8 .php files. I moved them to a different folder but the upload: directive didn't work. Can you please give me exact commands to write in my app.yaml for putting them in the root? 
 


It's difficult to recommend what you should do, since you're working within a WYSIWYG editor and not directly handling code and files via an IDE. I suspect that even if we modified the folder/file structure, Muse would have issues when building its own internal representation of the site.
 
If you absolutely must get your site running as soon as possible, the easiest way would be to replace your forms and integrate Wufoo forms ( http://www.wufoo.com/form-builder/ ) or Google Forms ( http://www.google.com/forms/about/

Personally, what I would recommend is making sure your local dev environment is working correctly. Try downloading the PHP demo guestbook: https://github.com/GoogleCloudPlatform/appengine-php-guestbook/tree/phase3-staticfiles - and running it on the App Engine dev server. If you see errors, then your local computer is at fault (the applications are looking at the wrong path, etc). If it runs fine, then you can expand on the demo. For instance, you mentioned emailing the results of the form: the guestbook sample retrieves the form data from  $_POST['content'], so you could expand the guestbook sample to email the form submission by using the Mail API ( https://cloud.google.com/appengine/docs/php/mail/#PHP_Sending_mail ) to send the contents of that reference.

Ryan B

unread,
Oct 7, 2014, 5:09:37 PM10/7/14
to google-a...@googlegroups.com
I think Vinny P is on the right track. Only thing I can see (as stated earlier) is the PHP trying to upload as static files. Put the files back where they were then replace:

- url: /scripts
static_dir: static_website/scripts

with 

- url: /(.+\.php)$
script: \1

And try the upload again.
Reply all
Reply to author
Forward
0 new messages