I have a old php applications which was earlier hosted on Apache 2.2. Now I am trying to host it on IIS 7.5. I installed php with WebPlatform installer. Then copied directory to inetpub\wwwroot folder. Added this directory as application in IIS. But when I browse search.php, it pops up save as file dialog in the browser - asking to save the file. Instead should return the html response which browser can show.
If put sample index.php with phpInfo() in it. It works properly but not the acutal PHP files. Have I missed any steps?
Any php guys out there? I tried reinstalling, even with xampp, but no luck :(
You have installed it but might not be configured properly. You should follow instructions over here
Related
I am doing a Full Stack web developing course and I wanted to use the PHP Server extension for Visual Studio Code with Laragon serving as the virtual server. Problem is, when I right click on a .php file on VSC and try to "serve" it, the URL turns into something like this: localhost/laragon/www/IntroduccionPHP_POO_Inicio/namespaces.php, which yields a 404 error page.
If I remove the /laragon/www from the url so it looks like this:
http://localhost/IntroduccionPHP_POO_Inicio/namespaces.php, it works (I mean,
the .php file is loaded correctly) but PHP server doesn't update my page
automatically anymore.
I need to know if there is a way to tell PHP server to ignore the
/laragon/www path. Maybe some configuration that I am not aware of?
Btw, the php files I want to load with PHP Server are added to the VSC
workspace with their full path, which is c:\laragon\www. I don't know if that
is the problem and if so, how to solve it.
You should try to install MAMP or XAMPP instead of this. It will be more helpful. ;-)
MAMP : https://www.mamp.info/en/downloads/
XAMPP : https://www.apachefriends.org/index.html
I just started taking a PHP course and I'm having a lot of difficulties. I won't get anywhere unless this is resolved.
I got the course files downloaded and added them to htdocs folder but I can't run any new files I created. I get
Object not found! 404 error
I see them under localhost/coursefiles/whtever.php. I've google searched all day but can't find anyone else having this specific problem.
Would uninstalling and reinstalling XAMPP work? This is extremely frustrating and making me crazy.
First Check xampp manager Is your MySQL and Apache is in running state ?
Then Type Localhost in your browser , if Xampp Homepage is Coming It means Xampp is working Fine!
And again Checj your course files Extension they should have .php extension (if they are php files).
Create An folder In your Htdocs Folder With Abc(for example) and Write in browser's Url window "http://Localhost/Abc
if your Folder is opening and it's showing Files Then There must be a Problem with files! :)
I installed wordpress on my local machine (backtrack) for experimenting. After I got everything setup I moved it to an Ubuntu Server so that everybody can access those pages at work. I followed the same instructions, I moved the wordpress folder into /var/www but I created a new database with the same username, password and hostname.
The problem is whenever I access the webpage #ubuntu it tries to download the file, if access the page #backtrack it goes to the dashboard and everything is fine.
I did not have an .htaccess file on either machine sop I created one just to see if it will fix the problem but it did not.
Apache works fine because I can get to some folders I have setup by going to
"http://ubuntuserver/folder name"
and the logs shows no errors because it is delivering the webpage to the client just fine but the client is downloading it instead.
Any Ideas why this is happening??
Sounds like you haven't installed the PHP module for Apache or enabled it to use PHP using AddType in the Apache config file.
It seems that your WebServer ( Apache here, i suppose ) is not configured to use PHP module and/or is missing some PHP configuration options.
See here for some basic configuration tutorial.
i have another question. I am using WAMP as my local server. I have this file index.htm. The problem now is when I try to edit this file and reload localhost in the browser nothing' changed. But when i double click the html file to open it without WAMP server it diplays the edited one. I don't know why..
it's working now. I only have to put all files inside WWW folder and not inside another folder. Thanks everybody for the help..
Check that the index.htm is in the correct (WAMP) directory (usually c:\wamp\www)
Check WAMP is running
Personally i use XAMPP for mac (they have a windows version too) and place your Websites in /Applications/XAMPP/htdocs/ and access them via (http://localhost/) or you put your Websites in the Sites-Folder in your Home and access them via (http://localhost/~username/).
Obviously if you use windows the paths will be different, but XAMPP will provide you with a help screen on first boot.
I have Joomla installed in my computer, but recently have been writing php files that aren't related to the Joomla-managed site. For some reason, when I try to open those php files in the web browser using xampp (note: Joomla also is using xampp), the browser doesn't process the code w/in the tags as php code.
For example, after opening a basic page (a page with title "test", no content except in the body tags) in the web browser and going to the source code, the following is shows up in the source code:
<body>
<?php echo "hello"; ?>
</body>
instead of the HTML conversion. (i.e. just "hello")
Does anyone have an idea about what's going on here?
Thanks.
It's probably because PHP module isn't loaded in your apache. Be sure it is enabled
PHP is interpreted in the server, not the browser. Whatever's going wrong, you need to look at the SERVER side to resolve it.
My first guess: maybe you didn't suffix the file ".php" (so the server doesn't recognize it as a PHP file?)
Second guess: is the directory containing your PHP files configured to parse PHP?
If you have Joomla, you probably have PHP. You probably also have Apache.
So check your Apache configuration, and check your file naming conventions.
Is the file extension .php? The server doesn't magically know when you're serving php files, this is a good way to ensure it knows what you're doing.
Apache is looking into your localhost's defined root directory for files it can parse. In this case htdocs. This is the default for XAMPP. As far as Apache is concerned, it will not interpret any files outside of that folder.
if the problem in php module it better to re install php5 in to the system and it will work fine. probably the problem is in php module you should try re installing php in your system.
Just restart httpd service. It will work fine.
sudo systemctl restart httpd.service
if it has not worked please reinstall PHP once again.