Installing PHP on Windows 2003 Server Web edition...in 2022 - php

I had installed php and mysql on Windows Server 2003 Web edition many years ago. The hard drive crashed on December 23rd, 2021, and although I had all our data backed up, I did not have a system backup to save the OS and all configurations/installations. I have php scripts to bridge Adobe Air and mysql, so I have to stick with php.
Installing PHP 5.3 on IIS6, as was what was running before. The installation with FastCGI is straight forward and fairly simple to get php running, but I am stuck. After following the dozen or so "how-to" guides floating around the web, I am left with the same issue no matter what I try.
When running php.exe from the command line, I get "Access is denied"
I changed security of C:\PHP to allow full control for all users.
I changed the application pool identity to local system from network service.
I double-checked the .ini configs for php.ini and fcgiext.ini.
I believe every location for path variables has been updated/set properly.
At this point, I'm leaning toward something in IIS or Windows blocking access, but I have run out of ideas/options. A new server is being ordered, but we need to get this one up and running so we can limp along until we have new hardware/software to install our programs on.
Any help would be greatly appreciated.

This might be a long shot but have you tried to check that the .exe isn't set to "Read-Only" also you can try take ownership of the folder with the following:
Take Ownership on Right Click

Related

Start a PHP server on Mac OS X

I am figuring out how to use PHP OpenId
I have cloned the repo to the ~/www directory. There are some examples in the php-open-id/examples directory which I wanted to run.
Specifically, I wanted to render the page php-open-id/examples/consumer/index.php in order to better understand the API. I started a server in the php-open-id/examples directory using
python -m SimpleHTTPServer 8000
and I navigated to localhost://consumer/index.php
But it didn't work. It shows a dialog box to save the file. What is the correct way to render this PHP file?
I have found a solution :
Run the server using
php -S localhost:9000
Mac OS
Just Visit your project folder
open terminal on that folder
and Run php -S localhost:9000
then you can see
PHP 7.3.24-(to be removed in future macOS) Development Server started at Tue Mar 30 11:58:49 2021
Listening on http://localhost:9000
After that you are able to access your application on http://localhost:9000
if your port is not available try to change port
You need to have a php server for serving .php files. The simple python server is not a php server and therefore it is just simply listing the files in the directory for download.
If you are on OSX 10 or above, it comes with apache which has php module present and can be setup to serve php file.
Tutorials can be found here
http://php.net/manual/en/install.macosx.bundled.php and here https://discussions.apple.com/docs/DOC-3083
If you would like to setup a dedicated server instead of using apache, MAMP is a good solution. Google It and see tutorials on how to set it up.
Update November 2022:
Unfortunately, PHP has been removed from MacOS. This is a brief tutorial which explains how to get PHP working in Ventura.
I personally dislike the idea to compensate the lack of PHP with the activities outlined in the tutorial. My solution was to install Docker and to run a proper NGINX+PHP container. I consider it to be cleaner, more flexible and better to maintain rather than faffing about with half-baked on-board stuff. But that's a matter of taste, I guess.
Also, as suggested in one of the answers, using the Python approach is not hassle free in Ventura, since it requires xcode to be installed.
In MacOS 10.x I have also been working with the on-board Python and PHP. Having lost those tools as standard installations is annoying.

Should I use wampserver on Windows Server 2012 R2 or install apache, mysql etc. on the server

I am setting up a server for the first time ever (no prior experience) and got the static IP setup for it no problem. The next step is to setup the server to have a mysql database so other local machines can connect to it. Is it best to achieve this by installing PHP, MySQL, Apache etc. separately or to use something like wampserver?
I figured wampserver would be the straightforward approach but doesn't using a virtual server on a server defeat the purpose of it? Basically looking for some direction or a link here as I am completely clueless
WAMP server basically packages those different programs together and gives you things like a program icon, a system tray icon to control servers, readymade links to say phpMyAdmin. The underlying servers are the same as the 'original' ones. As such you may find WAMP server easier to install AND easier to administer.
Downside - the WAMP server does NOT includes latest 'originals'. They latest originals make it to WAMP server distribution with some lag. If you need latest say PHP, then better off installing them on your own.
WAMP server is a collection of Apache, Mysql and PHP modules.
WAMP server is same as having each component installed separately, however WAMP server gives you a package that is very user friendly in terms of quick shortcuts like (starting/stopping server, activating modules ans so on) which you would have to do manually (by editing config files if installed separately)
Pros of WAMP
Userfriendly
Easy to activate/ desactivate modules
Additional features (phpmyadmin,sqlbuddy etc..)
Cons
Difficult to upgrade
Securitiy issues
Performance issues

Multiple versions of Apache installed and conflicting

I started trying to create a website which uses PHP on an old computer (previously used by another programmer).
I wanted to test my PHP code without uploading it each time, so I downloaded Apache and installed it. I was starting to set Apache up when I discovered this computer already had Apache on it.
Now I had multiple versions of Apache, so I went into add/remove programs and got rid of Apache (which only showed up once in the list).
Unfortunately windows decided it would uninstall the old version and keep mine which was not functioning properly. Also for whatever reason it seemed to have kept a good few files from the old version, but not enough that I could actually use it in any way. I believe it just had some configurations files.
I thought I would copy my files from the new version into the old version and not replace anything so hopefully I would be able to run under the older configurations, but that didn't work.
At this point I just wanted to cut my losses, so I put all the versions of Apache in an archive so there was no way the computer could be using them. I also removed Apache from the windows startup and rebooted the computer after configuring one single version of the newer copy of Apache to supposedly run PHP.
The problem is upon startup I could immediately log in to localhost and apache was already running. Also when I opened Apache manually from the files I had left unzipped, it only gives me the option to start Apache (not an option to stop or restart implying it is not running) and when I click it, it says "The requested operation has failed!" which is less than helpful.
So anyway, I just want to be able to run PHP locally and now I don't feel like I can even successfully uninstall and start from scratch anymore. Does anyone know what I have to do to get this to work? Sorry for the long description, I wove such a tangled knot.
One way to solve is use a XAMP (Apache + MySQL + PHP) client like XAMPP http://www.apachefriends.org/en/xampp.html brings it all set up for you to use. The problem of conflict can be caused by any IDE (Netbeans for example) that already carries a version of Apache.
Try to configure config files of Apache case exist.
Assumption: Running Windows OS for development and linux for production environment.
My recommendation is to not mix the Windows and Linux worlds as while they can be made to behave after lots of work, it is usually more pain than good.
Instead, as a humble windows and linux user, download and install Virtualbox [https://www.virtualbox.org/wiki/Downloads], a free open source virtualisation tool.
Then download a linux distribution of your choice and install that into a new virtual machine.
Configure the linux tools inside linux and leave your windows machine relatively untouched.
A useful linux service to install would be Samba - windows file sharing - you can use this to edit your code in windows using any IDE of your choice, while saving directly to linux and testing through linux. When happy, upload from the linux system (again like any other file uploader) and all will be well.
If you are deploying to a linux based environment in your production service then this will help you avoid common mistakes such as case-sensitivity trouble and many others.
Building and running this system is free and it will help teach you more about the linux environment you are deploying to also.
Equally, when you don't have the virtual machine booted, there's no services lying around exposing your computer to possible local network threats and consuming resources - as opposed to installing Apache on Windows where it will be using some resources all the time.

Create an Installer package for Installation on WAMP

I have developed a PHP web application, now I am thinking about deploying it on Windows.
To ease my deployment, I plan to create an installer for it. This installer should do the following:
Check for Pre-requisites such as Apache, MySQL etc, install them if they are not available
Put the PHP application on Application folder, and in this process set the port number, create a conf file for the application, update the httpd.conf to make sure that it refers to the application-specific conf file.
Run database setup script and database population script that I prepared.
Set the database setting in the application config files so that they are pointing at the correct database.
I am looking for a installer to help me on this regard, something like Advanced Installer. Of course, I still have to write a lot of custom actions code for it, which is something I really hate.My question now is that is there anyone who has done all these stuffs and are willing to share his code, so that I don't have to do everything from scratch?
I think you are looking for this http://installbuilder.bitrock.com/. Bitrock is used by a few big projects like SugarCRM, etc to get their LAMP stack on other computers. Give it a try!
You could try movAmp. This will pack your application to one working executable, including apache/php/mysql.
Your application therefore should be aware if it is installed or not, say redirect to an install-script on first hit.
Movamp is an environment of
development to be taken.
MovAMP was conceived to hold on a key
USB or any other support of weak
capacity. Connect it up in a computer
equipped with Microsoft Windows and
you have access to a server web,a
database and INTERPRETER PHP. If
MovAMP succeeds in contenting himself
of not much of space, he can offer
also installed on a workstation.
Comparable in EasyPhp or WAMP5, MovAMP
inserts APACHE 2.0.54, MYSQL 4.1.12,
PHP 5.0.4 and phpMyAdmin 2.6.2-pl1.
Exits of the development of free
software, these technologies proved
their fastness and their stability.
Once thrown, he adds an icon to the
zone of notification allowing to stop
the server Apache and MySQL or to
achieve the reception of the site or
in phpMyAdmin.
Link

What's the easiest way to test PHP in Windows XP Professional?

I want to test some PHP on my local machine running Windows XP Professional. I'm familiar with coding PHP for upload, but not with running a web server.
What is the easiest way to set up a test environment? Step-by-step instructions would be great if you can give them.
(I see WAMP recommended in this thread - thoughts?)
Update - a year later
A little self-promotion: after using XAMPP for a long time, I began to want things it didn't include. (Support for PDO was a big one - every time I tried to enable pdo and mysqli simultaneously, something crashed.) I eventually worked through the process of installing Apache, PHP, MySQL, and PHPMyAdmin individually, and documented the process with screen shots on my blog.
Some of the configuration that I was able to do this way could have been done in XAMPP, but it was only because I had to set things up myself that I discovered new things (like being able to serve files out of c:\whatever instead of c:\program files\apache\htdocs).
On the whole, I'm happier with having installed these items separately. But XAMPP was a good (and easy) package to start with, and served me well while I used it.
(source: apachefriends.org)
Xampp is the simplest. You can setup everything in a Step by Step and if you require further configuration (Virtual Server, extension) you have the normal php.ini and other file in the directory that you can edit yourself.
Here is the Step By Step installation for Windows.
XAMPP from ApacheFriends is pretty simple to set up and use.
note the site appears to be down as at 15:02 UTC on 3rd Dec 2008
note again and it is back!
Instead of WAMP, I recommend XAMPP, for Cross Platform (X), Apache, MySQL, PHP, and Perl, all in one package. It is very simple to setup and use, and like WAMP puts an icon in the system tray to manage it all.
You can get it here: www.apachefriends.org/en/xampp-windows.html. This site also includes comprehensive instructions to get up and running quickly.
There is even a portable version available at http://portableapps.com/apps/development/xampp.

Categories