Hi i have a small api done in php which i want hosted on windows azure, i have downloaded the php sdk, and created a project and put my php folder in it, which has the ext folder and my php-cgi.exe, and also a php.ini file. when i do phpinfo(); it shows that the php.ini file referenced is in C:/windows not in my project folder which is in E drive, also the ext folder reference is shown to be c:/php/ext, which is also wrong, how do i make it point to my ini files within the project. please help ?
Try changing the config to something like:
<application fullPath="%RoleRoot%\approot\Content\Php\php-cgi.exe" arguments="-c %RoleRoot%\approot\Content\Php\php.ini"/>
I recommend reading the articles available on the Azure PHP website. This is an official Microsoft website that is run by the Interoperability team at Microsoft. They have lots of good info around PHP on Windows Azure.
http://azurephp.interoperabilitybridges.com/articles/build-and-deploy-a-windows-azure-php-application
Also, after you have the development environment setup take a look at this tool which allows you to conveniently package any PHP application for Windows Azure:
https://github.com/blobaugh/paz
Related
I have a "web site project". In my project I am using the php exec to use the ubuntu package PDFTK to manipulate pdf.
For example I have this line of code(php) in my model, I am using code igniter :
shell_exec('pdftk /var/www/html/IntegrSupCours/uploads/GKAG01_FR.pdf dump_data output /var/www/html/IntegrSupCours/uploads/bookmark.txt');
Indeed Im starting from /var/www to access to my pdf file, because I am on ubuntu.
But let's say that I am on a localhost ubuntu pc and I want to migrate my site on a online server what will happend if I am changing to that, because the url string in my shell exec to access at my pdf file will be different ?
First of all the remote online server that you are mentioning is a machine with some operating system like ubuntu installed on it.
Also, the path that you are specifying is a path that is generally used by most of the web servers.
It is all about where you are installing your application on the online server. If you install the application at the same location as it is in your local, you will be able to see the pdf file in the online server too.
Is it possible to run Cake 3.0 or higher on Azure Web Apps? I have an app running locally on a 3+ version but when I installed CakePHP on my Azure web app it's running 2.5.1.
I feel like it's just a matter of uploading all of the newer files and the db created for the 3.0 version but scared there is some kind of write access the new cake will need thus preventing it from running and burning a ton of my time.
I started learning PHP 3 weeks ago so calling me a newb is probably an insult to newbs.
This article tells answered most of my original questions regarding this issue.
Yes, it is possible to deploy CakePHP > 3.0 applications to Azure Web Apps. But we need to some preactions to make the application to run. Generally, you can try to following steps:
Create an empty Azure Web Apps, and enable Composer extension, and also you can enable Visual Studio Online for easy script modifications and command running. Refer to https://azure.microsoft.com/en-us/documentation/articles/web-sites-php-mysql-deploy-use-git/#enable-composer-automation-with-the-composer-extension for more.
Create a file named web.config with the content at http://book.cakephp.org/3.0/en/installation.html#iis7-windows-hosts in the root directory of your application.
Add the inlt extension in PHP runtime on Azure. Add a folder named ext in your root directory, create a file ext.ini in this folder with the content:
extension=php_intl.dll. Add an App Setting to your Web App with the key PHP_INI_SCAN_DIR and value d:\home\site\wwwroot\ext. You also can do this step leverage Visual Studio Online extension after deployment. Refer to https://azure.microsoft.com/en-us/documentation/articles/web-sites-php-configure/ for details.
Set up the development environment of your Azure Web Apps, deploy your CakePHP application to Azure via Git. Refer to https://azure.microsoft.com/en-us/documentation/articles/web-sites-php-mysql-deploy-use-git/#set-up-the-development-environment for details.
I want to make my php project distributable like .exe file.
is it possible to customize wamp or xampp to inclue my project folder in that so i can ask client to install that wamp/xampp and my project will be automaticall setup on their system
Check out phar for creating a php archive.
Using uWamp server we can bundle php project with mysql and distribute it easily. Check this
If my question has already taken place in other post, please excuse me.
I am coding a PHP - MySQL website and publishing it on IIS.
The way that enables me to do this is enabling CGI extension of IIS and copying the source PHP files to a folder under the "inetpub" folder.
Here is the question. If i DON'T want to copy my PHP files (which are including my codes obviously) into "inetpub" folder, is there a way to make a package file of my PHP files? For example a Tomcat server executes ".war" package files. Is there a package file type that i can put my PHP pages in it and deploy it on IIS and publish it on IIS?
If there is no way to achieve this, what can i do to prevent copyng and pasting the PHP files into "inetpub" folders?
Thank you all.
You can take a look at Web Deploy. It doesn't package the files as compactly as WAR but it's the "official way":
http://www.iis.net/download/WebDeploy
I have a question concerning Zend Tool. I am trying to install Zend Framework on a shared hosting (bluehost if that matters). I have unpacked the latest Zend Framework into my public_html folder and added the path of the framework's library to php.ini include_path.
When I try to run zf.sh with any arguments (for example, zf show version) I get an error:
Action 'path_to_zf/bin/zf.php' is not a valid action.
What could be the source of the problem? Thanks.
To run a Zend Framework website on a production server, you should use a development computer to create the website and then upload the website code to the production server using a deployment strategy such as capistrano, a phing script, rsync or even plain old FTP.
On your local development computer, you use zf.sh (or zf.bat on Windows) as per the instructions in the Quick Start. Once you are happy that it works locally, upload to your shared hosting.
To get a PHP environment on your local computer, consider installed WAMP or Zend Server CE.
I just went through this (with BlueHost) myself.
You mentioned that you added the proper path to the include_path in public_html/php.ini. There are a few other things to check.
First: By default, BlueHost servers are configured to use a different php.ini file (located in /etc/) unless there is another php.ini file in the folder that you are running your script from. You can check by running <? php_info(); ?> and looking for the value for Loaded Configuration File.
In order to get every script in every folder to use the php.ini located in public_html/:
From cPanel, under Software/Services click the PHP Info link
Select PHP x.x (Single php.ini) for the same version as is already
selected (to ensure compatibility).
Second: You'll want to make sure you've added an alias to your .bashrc file (see here)
At this point if your problem isn't solved, you'll want to consider a different method of checking whether or not Zend Framework will be available to your .php files:
Save Zend's Installation Checker file and upload it to the root path of your server. Then view it in your browser. It will tell you if you have installed zend framework correctly.
All tests pass for me, so I don't care that I still get the same error as you when testing through ssh via # zf show version.
More on installing Zend: https://developers.google.com/gdata/articles/php_client_lib#php-path-installation
More on BlueHost php config: https://my.bluehost.com/cgi/help/551