I can´t run .php pages on my Microsoft Azure Web Aplication - php

I'm trying to hoost a website on Microsoft Azure and I did it. But when I enter in my website to a .php page the browser answer with the next error message: "The page cannot be displayed because an internal server error has occurred."
Before that, it returned a 500 error code, but searching the internet I tried to configure de Handler Mappings option (I dont know if I did it good or not, but now that is the new error message).
Is there any required configuration I have to do in order to make .php pages work? I have the "shared" payment plan, Do I need a better payment plan in other to do it?
Thank you!

When I knew there wasnt any extra configuration to run PHP I realized that the only one thing I changed was the Handler Mapping options, so I disabled it and tried with a simple phpinfo() in a index.php .
Exactly, the error was a bad php code. Thank you very much.
NOTE: Other person said me how to get logs for php 500 errors, you can find how to do it HERE.

Ensure that PHP is enabled for you Azure Web App. Go to the Web App in the Azure Portal, click Settings and then Application Settings. There is a dropdown labeled PHP version. Make sure it is not set to "Off" (select your preferred version). Then select Save.

Related

How do I enable PHP to run on my website instead of a 405 error?

I'm trying to use a HTML/PHP form on my website. The problem is submit just opens a new page displaying my php as text, this is when I open the html file on my computer using Google Chrome. When I uploaded to my hosting service, TK dot com, I get a 405 error when using the form. I've tested on working/downloadable php forms and the same thing happens.
From my understanding, I can't just use php on my site without setting up an environment. I've read I need to use some sort of program to do this (apache). Which kind of confuses me further, how would I enable this type of service, which installs to my computer, to run on my website when my computer is off?
Any tips or guides on how to do use apache for PHP forms on my website or similar that I can be redirected to would be really helpful. Please let me know if any extra information is needed.

PHP / Magento page down module

I want to know whenever a page is throwing an error exception (500 server error). Send an email or something.
Is there a magento module or PHP module that achieves this?
Thanks!
If server is down, your web content won't be served. This includes Magento as well since it's php application.
The best way would be
check your logs
use other monitoring tools
Related:
Nginx bad gateway, how to notify
https://askubuntu.com/questions/9107/what-tools-do-you-use-to-monitor-a-web-server

Sagepay Direct - PHP integration with Wordpress

I have set up a simple Wordpress site with an order form but I'm struggling to get the site to recognise Sage Pay.
I've been following the initial instructions in the PHP integration kit - http://www.sagepay.co.uk/support/find-an-integration-document/direct-integration-documents:
Create a database and add the necessary tables.
Edit the /lib/config.php and the /demo/config.php to include my Sagepay Account and database details
In the test server for Sage Pay I also added the IP address of my site as an exception.
Every time I run the https://mywebsite.com/demo it returns the error:
Ooops!!!
An unexpected error seems to have occurred.
Try to refresh the page or you can contact us if the problem persist.
This is pretty early on in the but I seem to be doing something wrong. Is there something else that needs edited as the instructions are frustratingly vague.
Would I be better just using a Sagepay Direct plug in with Wordpress e-commerce solutions?
Thanks.
I am also a currently frustrated Sagepay learner. To asnswer you question, I had this problem too. My problem was that i had the database details incorrect. I had my local host details on my test environment, and i had not changed the details correctly in demo/config.php before ftp the file to my webserver. Once i did this, i got over the oops screen. The next problem was that i got a blank screen when running index.php from demo. I was told by sagepay that apache needs restarting as a service everytime somethingortheother happens. So on my local environment i restarted all services in wamp and it worked. I can now see the demo (not that i know what to do now as there are no instructions and the php is hidden in a complex class structure with the html content in some tpl files which i have never seen before - of course there are no instructions in the integration kit at all). Anyway back to the answer. So locally i can run the demo, but i still have white screen on my webserver, becuase i can't restart the apache service there, so that is the next problem. I will keep trying and add anything useful later.
I also had this problem, I had not given the database user account the necessary permissions to access the database.

Filemaker with PHP

Im using Filemaker API in PHP to retrieve the records from Filemaker Pro 11 Advance Database.
But its showing error:
Error: Communication Error: (22) The requested URL returned error: 404 - This can be due to an invalid username or password, or if the FMPHP privilege is not enabled for that user.
Though I have set all Extend Privileges and gave it to user.
Please anyone can help me...
Although you mention you've taken care of this, whenever I've come across this problem it's been because the user being used to log in with PHP doesn't have the fmphp extended privilege set.
First know which user you're trying to log in as in PHP. Then, in FileMaker choose File>Manage>Security from the menu bar. Take a look at the Accounts tab and note the privilege set assigned to your web user. Click the Privilege Sets tab and double-click on this privilege set in the list. In the Extended Privilege list on the bottom right make sure there is a checkbox next to "Access via PHP Web Publishing".
While you're there, double-check the password you're working with. It has to be either you're not working with the right extended privilege set or you're not logging in with the right credentials.
I am pretty sure you must have resolved this by now but if you have not here is another suggestion. I had the same issue today and had all the extended privileges set.
The issue was with FileMaker API. Make sure the Php FM API being used is of the same version as the FileMaker server in which your db is hosted. FM Server 11 will require API released for FMS 11. I was using the last standalone API released for FMS 9 and hence it did not work. On updating php to FMAPI 13 I was able to connect and get the layouts.
The FileMaker API for PHP package was included as a .zip file in the following location:
For IIS (Windows): drive:\Program Files\FileMaker\FileMaker Server\Web Publishing\FM_API_for_PHP_Standalone.zip
For Apache (Mac OS): /Library/FileMaker Server/Web Publishing/FM_API_for_PHP_Standalone.zip
Double check your connection params, it should look something like this...
// filemaker server connection param
$connection =& new FileMaker('DBName', 'http://www.domain.com');
$connection->setProperty('username', 'youruser');
$connection->setProperty('password', 'yourpass');
First, check if the PHP API is installed and running.
On the server, go to http://localhost - You will see a screen telling the PHP API is running. If you see something else, you probably have to dig into the installation of the PHP API - possibly redeploy the server and checking off the PHP API. See that the server passes the web-server test.
Next, Check that the user that logs on to the server has the right privilege set. We usually create a second account for the PHP API, where the privileges are set correctly to MODIFY records, and VIEW Layouts, and of course have the fmphp attribute set.
If you still cannot connect, try from the web-server to do a
wget http://fmhost_ip/
cat index.html
see that you get something that can resemble a FileMaker API running page (look at the HTML code output).
Make sure you get the "FileMaker Database Server Website" landing page on the url (without the /fmi/... address), My issue was using another domain/sub-domain that IIS was using for another website.
I know this is really old. But in addition to the ISAPI fix. I needed to add a URL rewrite rule. The pattern needed to be:
^fmi/(.*)
And the rewrite URL needed to be:
http://localhost:16020/fmi/{R:1}
With those in place, the PHP API started working again.
after a few hours trying i found a solution to comunicate the php with the IIS... on your IIS manager, just need to add to your default web site, in ISAPI Filters, and add this executable... "C:\Program Files\FileMaker\FileMaker Server\Web Publishing\publishing-engine\web-server-support\iis\isapi_redirect.dll" - with anuy name

page redirection with unknown pages

I am developing a website in php.
when a user types a page which is not in my site, i want users to redirect to a page with an error message.
how can i identify such things and how can i do this??
Thanks.
If you're using Apache web server, you get this functionality for free. No need to implement it yourself. If the web server cannot find an resource it sends the client an HTTP 404 error (not found). Actually, pretty much any web server that correctly implements HTTP (1.0 or 1.1) will behave this way. Additionally, in Apache, you can customize the 404 page.
If you're using Apache, here's instructions:
http://www.thesitewizard.com/archive/custom404.shtml
This is not really a php feature, but more of a feature of your web server. In IIS you can configure the error page to go to a custom url. In apache i think you can usr mod_rewrite to achieve the same thing
Other than what others said this might be of some help too "Custom 404 Error" if you are using Apache.
If some script is launched on all of your pages (it can me unit, which is always included) you can make a check there. You should write there all of your available pages and if the required page is not in the list - you can show person, that he/she was wrong.
Sometimes the list of pages is jept in database. Most CMS-systems are based on that.

Categories