PHP in Azure cloud service - php

Can any one suggest what is the configuration need to be done to run a simple php file in the Azure cloud service.
I am able to view my simple php file in Azure Web Site, But i cant view the same file in Azure Cloud service.
Can some one provide me some suggestions?

When you say "I am able to view my simple php file in Azure Web Site, But i cant view the same file in Azure Cloud service.", I believe you mean you can browse your PHP site in Windows Azure Websites however not with Windows Azure Service configured as something.cloudapp.net. Isn't it?
As you asked for suggestions here are some steps you can use to troubleshoot your problem:
When you access your PHP file i.e. servicename.cloudapp.net/phpinfo.php does it shows file not found error or it returns error related with PHP runtime? This is because you would need to put together PHP runtime as well as all the PHP files in your package before deploying it. If you miss any of important content, your site will not run. So you must be sure that all the contents specific to your application are in your Package which you deployed to Windows Azure cloud service.
To verify you have all the contents in your Package, you can rename cspkg to zip and then unzip it. After that you can rename cssx file to zip again and unzip it to see if all the contents are there.
You can enabled RDP access to your Azure VM and log into to check for consistency
Also for Azure Cloud Service you use this documentation: http://azurephp.interoperabilitybridges.com/articles/packaging-applications

Related

Command for downloading all website project files

I have access to server of our company's website. I access it using Putty.
I want to download all files(index.php, any jpg files for favicons, etc.) used for deployment of the web project. When I told to programmer of website to share the full script(HTML,CSS,PHP, jquery plugins), he said that I can access the entire code from server.
When I enter the server via Putty(private key+ssh), and then I type "ls" I see that there are "index.php" and "mysql" files, the full contents of which I cannot download.
What are the useful resources for list of commands?
Which command should I use to download the project folder containing all files with code and without code?
P.S. I do not know if this information is necessary, but the website was deployed using DigitalOcean.
As you are using Putty, I'll assume you are working on Windows. There is a GUI tool called WinSCP that works similar to Putty (i.e. over SSH and uses private keys and stuff) and can be used to access the remote server's filesystem. It has a pretty simple to understand UI which will be divided into you local filesystem and the server filesystem. Once you're connected and have reached the files you need you can just drag and drop the files into your local filesystem side.
If you would like to explore some command line options, its basically any tool that does scp. I think Putty comes with scp or pscp installed already. You can check by just typing in the command in your cmd/powershell.
You can download pscp.exe from PuTTY website and then:
Open cmd.exe and type:
pscp your_username_here#yourcompany.com:/path/to/file C:\Path\To\The\New File

SOS! How do I deploy multiple Laravel apps on a windows IIS server in a LAN

I am setting up an IIS server in readiness to host multiple PHP web apps. These will be used within our local network so no need internet access. I have read a lot of stuff on how to go about it but am getting lost even more. someone please help.
You can refer to this document for detailed steps about deploy php application on IIS.
Here are some main important points:
Install IIS in control pannel(windows) or server manager(windows server).
Configure php. Youcan download it from php official website or Web PI(more recommand). The version over php8 may not work on IIS.
Make the physical path of site points to root folder of application. It will auto generate web.config. Set the permission of root folder to avoid 500 error.
If you have multiples version of php, you can isntall php manager to configure them.

Shared network drive as Laravel 5.4 Storage

I have an image upload in my Laravel application and would like to have those images uploaded to shared network drive located on external Windows computer.
Is it somehow possible to mount a spesific folder at my shared network drive as Laravel Storage? Laravel 5.4's manual says that there is only s3 and Rackspace included as build-in drivers.
Thanks in advance.
I had a similar requirement and solved it by mounting the network share to a folder (or you could mount to a drive) in the local file system. There are plenty of guides on the net for doing this depending on your server operating system. You can then use the "local" file system driver to access the files.
Note that this means some sort of script on the server needs to handle connecting with the credentials required, rather than the laravel application, which may/may not be suitable in your environment.
You can use different drive to store your upload media. For example if you want to use googleDrive as your storage drive just need to follow below steps:
1) Pull filesystem adepter for google drive
2) Setup config/filesystem.php
3) Setup service provider
Setup .env with client ID and authentication stuffs and done.
You can check the detail about how to setup GDrive by this example code.

How to host Codeigniter app on Azure?

I wanted to ask you to help me (with some tutorial link or something), what i want to do is to upload php Codeigniter application on azure?
Also in my application, I got upload feature so I should make it work too (don't know if it's more complex becasue of that).
I was using wamp during developing, now I need to push it on server.
Generally, deploy a CI application to Azure Web Apps is simple, you can simply create an Azure Web Apps on Azure portal, then step in the manage page of your Azure Web Apps, click All settings=>deployment source=>chose source=>Local Git Repository to set the git deployment setting of your Azure Web Apps service.
Then you can find the Git clone url under the essential tab.
Additionally, Azure App Service can run php composer.phar install when you run git push, but it's not enabled by default. To enable it, you need to install the Composer extension for your web app.
Here is a CI template on Azure sample, you can refer to https://github.com/Azure-Samples/app-service-web-php-get-started for any hits.
And here is a video https://youtu.be/bBb_Hi2Odqc, you can refer to. It manages on the classic portal, but still works today.
Deploying Codeigniter is very easy, all you need to make sure is placing the project directory correctly.
Just upload the project folder to the hosting either by SSH or FTP.
Modify the .htaccess file accordingly.
Once all the above is set up, including uploading all the files to host, don't forget to update config.php database.php and route.php with new hosting parameters.
To make your upload feature work correctly you just need to give proper/required write access to the upload folder of the application.
And that's all you need to do while deploying Codeigniter application.

PHP shell_exec doesn't work in Windows Azure

We need to execute an .exe file in a remote Windows Azure Server.
We call it from PHP with shell_exec. The .exe should create new files in two different folders into the server and generate data entries in a data base and returns a string, but it doesn’t work.
We don’t have any problem executing it in our local server with windows 7 Enterprise and IIS 7. That’s why we thought it could be a permissions problem, and then we have created a .user.ini file with the following content:
safe_mode= off
safe_mode_exec_dir= off
Unfortunately it doesn’t work too.
Any suggestions?
Thanks in advance.
You are most probably working with Windows Azure Web Sites. This is a high-density shared hosting with tightened security. If you need things like shell_exec you shall move to Windows Azure Cloud Service (Web Role), where you have full control over the OS and web server / php settings.
Using Cloud Service you will be able to use shell_exec. However when you move to Cloud Service you have begin thinking of saving files in Azure Blob Storage, as the local storage for cloud service is:
Not persistent
not synchronized across role instances
If you want don't yet know what Role and Role Instance is, or are little confused, please go through this article.

Categories