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.
Related
I have a php application (ARPReach) installed on a Azure VM. I use Task Scheduler to run a .bat every 5 min that has this simple line of code:
"C:\Program Files (x86)\PHP\v5.4\php.exe" E:\Web\arp\a.php cli/auto
Now I want to move this php app to Azure Website, and I need a similar scheduling functionality as the above.
I got the path to php.exe from the Kudu site and added a Webjob (cron.bat) to my website with the following line:
"D:\Program Files (x86)\PHP\v5.4\php.exe" D:\home\site\wwwroot\a.php cli/auto
and it seems to work fine.
However I'm not sure if this is the right way to do it with Azure Webjobs / Websites. I mean are the paths going to change after restart or auto-scaling?
Can anyone confirm for me?
Restart or scaling will not change this path, it should not change unless Azure Websites will stop supporting php version 5.4 for some reason.
So this batch file should work fine, I would use %ProgramFiles% instead of D:\Program Files (x86).
I've been working with a WAMP setup on windows, while learning PHP and MySQL. Lately, I wanted to try to put some of my work online and signed up for Rackspace, and I've now set up a LAMP environment for my server with centOS 6.5.
When I worked off of my own WAMP environment, all files were inside wamp/www as the root directory.
Now, I understand that my root directory for my web environment will be /var/www/html.
To be clear, I am logged as root, so I'm not interested in changing permission. I'm simply interested in learning how to add files into this directory, which the existing posts on stackoverflow or rackspace does not seem to have an answer for.
I'm completely new to Linux and I'm using Putty to write to my linux server. Could someone please walk me through the process of putting files into and taking files out of /var/www/html?
Use pscp from the putty suite, to copy your files from your machine to the server via scp.
See http://the.earth.li/~sgtatham/putty/0.60/htmldoc/Chapter5.html
I have a php application, I want to install it on another PC so they can use it but i want an automatic way that will install XAMP & copy my application files to that PC without me doing all these is there any installer I can use?
I need it to install XAMP automatically
Need it to copy files from installer & paste in the xamp folder.
Create a desktop icon so they can launch & start using it.
It will open browser, will run the apache in the background. and execute the php
anything to resolve?
Popular CMSs like Wordpress do installation just by copying the files and launching the SQL scripts for the database - create database and fill test data if needed. Which is fine.
The real question is how do you install XAMPP in the first place. Because for that it's not enough just to copy files. And even if you do manage to install XAMPP, you have to automatically start the Apache and MySQL. Don't say that it's impossible, but I think you should look for an easier way and deal with that another PC owners.
I have been developing a PHP project solely in Dreamweaver. After determining that Netbeans will make my life easier, I installed Netbeans 7.2 for PHP.
I followed the project setup guide, yet I am having issues with the project folders. I can edit and save source files, but how do I update the files on the localhost?
Specifically, I have the project source files located on our work drive, which I can use as a regular hard drive. I even have a site file for this project in Dreamweaver, with the source folder, the local folder, and the remote folder profiles all set up and functioning well.
Do I need to change how I store the project files? My Netbeans project properties are as follows:
Sources
-Project Folder: D:\work\cms\current
-Sourec Folder: D:\work\cms\current
-Test Folder:
Run Configuration
-Configuration: <default>
-Run As: Local Web Site (running on local web server)
-Project URL: http://localhost/cms/current/
-Index File: index.php
And I see no other relevant settings, but if you ask about any I will update my question.
When I make a change, I save and select Run. The page loads as expected, but the changes are not there, the localhost copy did not get updated. How do I resolve this?
You could install an FTP server e.g filezilla server and in the project "run configuration" change to remote web server, then specify localhost and the ftp details.
Or create a script to copy over the project e.g .bat or .sh depending on OS.
Or change your project location to be inside the localhost web directory and just use it in there.
I had the same issue, I gave in and now have apache pointing to my project folders on my development machine.
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