Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I just installed PHP and Apache2 on my laptop (ubuntu 12.04), but I can't get my PHP files to load. I have followed this tutorial: http://www.howtogeek.com/howto/ubuntu/installing-php5-and-apache-on-ubuntu/ , and the index.html file works, but when I try any php, I get a server error.
I looked online for a few hours, and I added "AddType application/x-httpd-php .php" to my httpd.conf (but I don't think I'm supposed to be editing that file for the ubuntu version??) in /etc/apache2/, which somehow let ONE php file load (which just contains phpinfo()). I then tried making a new php file with the same code, but that one won't load (server error). I have no idea why it only loads that specific file. I have tried restarting apache and opening the other one first, but for some reason, it only loads the first file. I also tried to move the file to another directory in /var/www/, but not dice. I hope this makes sense, because I'm a beginner here.
any help would be appreciated!!
I think you didn't install the last version of php, try to install php5
apt-get install php5
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 1 year ago.
Improve this question
I tried to unzip it inside the app folder but it just duplicates itself
xampp-osx-8.0.2-0-vm 2.bz2.cpgz
xampp-osx-8.0.2-0-vm.bz2.cpgz
xampp-osx-8.0.2-0-vm 2 2.bz2
xampp-osx-8.0.2-0-vm 2 3.bz2
xampp-osx-8.0.2-0-vm 2.bz2
xampp-osx-8.0.2-0-vm.bz2
and goes on...
How can I install XAMPP now?
Ohh Yeah!! That's solved now.
This is the common error in macOS higher versions especially in macOS bigsur
For this, Download the .dmg file instead of downloading the archive file from the apachefriendly site use:
[1]: https://xampp-for-mac-os-x.en.uptodown.com/mac/download to download the .dmg file of XAMPP.
For me, it works fine all servers are running well.
Also, don't forget to upvote if your error is resolved. 😇
ThankYou Community
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have been using Lampp on a test machine. OS is Ubuntu 12.1. It was working fine before and running my scripts. Then it began displaying a pop-up asking me if I would like to open or save the file? I have tried changing the ports and restarted the machine and restart Lampp. Nothing has worked so far though.
Your MIME types are wrong and/or mod_php isn't loaded.
What is in the files? If they contain your PHP code, Apache is serving the files out rather than putting them through PHP. Check you are loading mod_php.
If they contain the output of the PHP code (i.e. the HTML) then they aren't being given the correct MIME types. I'm not sure where this is done, I think Apache or PHP adds the headers automatically. Check the Apache MIME types config
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have installed Apache 2.0(httpd-2.0.64-win32-x86-no_ssl) and it works, then I have installed Php5.3 and it pointed to Apache configuration folder.
failed scenario:
1- create simple test.php, put in under C:\Apache\Apache2\htdocs
2- call "http://localhost:8080/test.php" --> "Bad Request..Your browser sent a request that this server could not understand."
Proposed solution by NetBeans blog (failed)
1-add those two lines to httpd.conf
AddType Application/x-httpd-php .php
LoadModule php5_module "c:/php/sapi/php5apache2_2.dll"
It doesnt works because there is no "php5apache2_2.dll" under my Php installation folder??
I have such .dll : php5ts.dll, ssleay32.dll,..
Any one have any suggestion in order to run the PHP script successfully?
It would probably be easiest to just download WAMP or a similar all-in-one web server, especially since your environment is most likely not a production environment.
Just download php5apache2_4.dll-php-5.3-win32.zip from http://www.apachelounge.com/download/
Here is a guide how to configure your apache to work with PHP 5.4
I know this is not what you asked for but why to use WAMP? First of all it's not a good idea to integrate you desktop with DEV environment (it gets messy quickly). Windows is not a natural environment for web application.
Get yourself a VMWare player (it's free) and install Ubuntu Server on it. Now you can work from Windows on your Linux server. You can also get your VMWare environment home if required.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am trying to run WAMP under my XP. I installed it to C:/wamp, than copied old php files for example like test.php to the www folder in wamp folder, than run it throungh browser from adress file:///C:/wamp/www/test.php. It includes
< ?echo("a");? >
but it still run like html without running code and showing php in source code.
What am I doing wrong?
I was thinking if there exist some browser which will automatically executes php and includes mysql database apache.
Is there something?
And at best run ajax and asp serverside parts
You are showing the file directly by the browser, nothing related to wamp.
What you should do is start wamp (maybe need some config, for example the path, the port .)
Then access your page like : http://localhost/test.php.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 12 years ago.
Improve this question
I don't know what to do. I read the related question on this site just like mine but those changes didn't work.
First, I edited the httpd.conf file and uncommented the PHP load module line. Next after getting this error "/usr/sbin/apachectl: line 82: ulimit: open files: cannot modify limit: Invalid argument" I changed ULIMIT_MAX_FILES="ulimit -S -n ulimit -H -n to ULIMIT_MAX_FILES="" or some odd thing. That resolved that error.
Then I finally added AddType x-httpd-php .php to the httpd.conf file because that was also mentioned in the previous question here on stackoverflow.
However I still just see my source code in Safari (actually Chrome decided to download the PHP file instead--different problem/story). Then I found a question similar to mine on this site and added some AddHandler lines to the php5.conf file which mimicked the AddType lines in the file after AddHandler. Still didn't work even after a "sudo apachectl restart".
I'm baffled. Please help. I'm just trying to get started so I can learn to program and I feel like I've spent a lifetime just trying to print 'Hello World' in my browser.
Whenever a server side script is being served as a file rather than executed as code, it means your server has not been configured properly. Make sure you have enabled the PHP module in your httpd.conf file and restarted the web server by opening preferences and toggling the "Web Sharing" option in the Sharing pane.
As a commenter noted, however, this is not a programming question but is a server administration question. Go look at the resources in serverfault.