How to Install PHP on Ubuntu Server [duplicate]
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
-1
down vote
favorite
This question already has an answer here:
What's the easiest way to set up a LAMP stack?
17 answers
ORIGINAL POST
This I would imagine is going to be a simple answer. I have Apache2 running on my Ubuntu server but it seems PHP is not installed. When I try to load a php page it does not load properly.
Example: http://urbanturtles.servegame.com/ (My Site)
At first I thought the php module was simply not loaded but when I try to run sudo a2enmod php
but it did not work and I get this error:ERROR: Module php does not exist!
Thanks for help in advance!
EDIT
After trying to load a simple PHP page to show the php version I have gotten a new error trying to load the page. that error is visible here: http://urbanturtles.servegame.com/version.php . This makes me think I have more of an Apache issue than a php issue. I have a main Apahce sever that proxys all incoming traffic to each server inside my network. The Apache config for the main server looks like this:
<VirtualHost *:*>
ServerName MaxKulik.net
ServerAdmin max@maxkulik.net
ProxyPreserveHost On
ServerName "www.MaxKulik.net"
ServerAlias "MaxKulik.net"
ProxyPass / http://192.168.1.5/
ProxyPassReverse / http://192.168.1.5/
ErrorLog $APACHE_LOG_DIR/error.log
CustomLog $APACHE_LOG_DIR/access.log combined
</VirtualHost>
<VirtualHost *:*>
ServerName MaxKulik.net
ServerAdmin max@maxkulik.net
ProxyPreserveHost On
ServerName "www.MaxKulik.net"
ServerAlias "MaxKulik.net"
SSLProxyEngine On
SSLProxyCheckPeerCN on
SSLProxyCheckPeerExpire on
ProxyPass / https://192.168.1.5/
ProxyPassReverse / https://192.168.1.5.
</VirtualHost>
<VirtualHost *:*>
ServerName USI
ServerAdmin max@maxkulik.net
ProxyPreserveHost On
ServerName "www.UrbanTurtles.servegame.com"
ServerAlias "UrbanTurtles.servegame.com"
ProxyPass / http://192.168.1.28
ProxyPassReverse / http://192.168.1.28
ErrorLog $APACHE_LOG_DIR/error.log
CustomLog $APACHE_LOG_DIR/access.log combined
</VirtualHost>
server apache2 php
marked as duplicate by muru, Eric Carvalho, Max Kulik, David Foerster, vidarlo Feb 8 at 6:00
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
 |Â
show 1 more comment
up vote
-1
down vote
favorite
This question already has an answer here:
What's the easiest way to set up a LAMP stack?
17 answers
ORIGINAL POST
This I would imagine is going to be a simple answer. I have Apache2 running on my Ubuntu server but it seems PHP is not installed. When I try to load a php page it does not load properly.
Example: http://urbanturtles.servegame.com/ (My Site)
At first I thought the php module was simply not loaded but when I try to run sudo a2enmod php
but it did not work and I get this error:ERROR: Module php does not exist!
Thanks for help in advance!
EDIT
After trying to load a simple PHP page to show the php version I have gotten a new error trying to load the page. that error is visible here: http://urbanturtles.servegame.com/version.php . This makes me think I have more of an Apache issue than a php issue. I have a main Apahce sever that proxys all incoming traffic to each server inside my network. The Apache config for the main server looks like this:
<VirtualHost *:*>
ServerName MaxKulik.net
ServerAdmin max@maxkulik.net
ProxyPreserveHost On
ServerName "www.MaxKulik.net"
ServerAlias "MaxKulik.net"
ProxyPass / http://192.168.1.5/
ProxyPassReverse / http://192.168.1.5/
ErrorLog $APACHE_LOG_DIR/error.log
CustomLog $APACHE_LOG_DIR/access.log combined
</VirtualHost>
<VirtualHost *:*>
ServerName MaxKulik.net
ServerAdmin max@maxkulik.net
ProxyPreserveHost On
ServerName "www.MaxKulik.net"
ServerAlias "MaxKulik.net"
SSLProxyEngine On
SSLProxyCheckPeerCN on
SSLProxyCheckPeerExpire on
ProxyPass / https://192.168.1.5/
ProxyPassReverse / https://192.168.1.5.
</VirtualHost>
<VirtualHost *:*>
ServerName USI
ServerAdmin max@maxkulik.net
ProxyPreserveHost On
ServerName "www.UrbanTurtles.servegame.com"
ServerAlias "UrbanTurtles.servegame.com"
ProxyPass / http://192.168.1.28
ProxyPassReverse / http://192.168.1.28
ErrorLog $APACHE_LOG_DIR/error.log
CustomLog $APACHE_LOG_DIR/access.log combined
</VirtualHost>
server apache2 php
marked as duplicate by muru, Eric Carvalho, Max Kulik, David Foerster, vidarlo Feb 8 at 6:00
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
I added some info to the post. This is not a duplicate question.
â Max Kulik
Feb 6 at 5:41
Why is it not a duplicate?
â muru
Feb 6 at 5:42
1
@muru because it's not a problem with php. see OP's comment below my answer
â Vishwa
Feb 6 at 5:42
1
@Vishwa I see both a problem with PHP (the link in the question) and a problem with whatever proxypass is being used (the link in the comment).
â muru
Feb 6 at 5:44
1
Is the final.
inhttps://192.168.1.5.
a typo or intentional?
â muru
Feb 6 at 5:45
 |Â
show 1 more comment
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
This question already has an answer here:
What's the easiest way to set up a LAMP stack?
17 answers
ORIGINAL POST
This I would imagine is going to be a simple answer. I have Apache2 running on my Ubuntu server but it seems PHP is not installed. When I try to load a php page it does not load properly.
Example: http://urbanturtles.servegame.com/ (My Site)
At first I thought the php module was simply not loaded but when I try to run sudo a2enmod php
but it did not work and I get this error:ERROR: Module php does not exist!
Thanks for help in advance!
EDIT
After trying to load a simple PHP page to show the php version I have gotten a new error trying to load the page. that error is visible here: http://urbanturtles.servegame.com/version.php . This makes me think I have more of an Apache issue than a php issue. I have a main Apahce sever that proxys all incoming traffic to each server inside my network. The Apache config for the main server looks like this:
<VirtualHost *:*>
ServerName MaxKulik.net
ServerAdmin max@maxkulik.net
ProxyPreserveHost On
ServerName "www.MaxKulik.net"
ServerAlias "MaxKulik.net"
ProxyPass / http://192.168.1.5/
ProxyPassReverse / http://192.168.1.5/
ErrorLog $APACHE_LOG_DIR/error.log
CustomLog $APACHE_LOG_DIR/access.log combined
</VirtualHost>
<VirtualHost *:*>
ServerName MaxKulik.net
ServerAdmin max@maxkulik.net
ProxyPreserveHost On
ServerName "www.MaxKulik.net"
ServerAlias "MaxKulik.net"
SSLProxyEngine On
SSLProxyCheckPeerCN on
SSLProxyCheckPeerExpire on
ProxyPass / https://192.168.1.5/
ProxyPassReverse / https://192.168.1.5.
</VirtualHost>
<VirtualHost *:*>
ServerName USI
ServerAdmin max@maxkulik.net
ProxyPreserveHost On
ServerName "www.UrbanTurtles.servegame.com"
ServerAlias "UrbanTurtles.servegame.com"
ProxyPass / http://192.168.1.28
ProxyPassReverse / http://192.168.1.28
ErrorLog $APACHE_LOG_DIR/error.log
CustomLog $APACHE_LOG_DIR/access.log combined
</VirtualHost>
server apache2 php
This question already has an answer here:
What's the easiest way to set up a LAMP stack?
17 answers
ORIGINAL POST
This I would imagine is going to be a simple answer. I have Apache2 running on my Ubuntu server but it seems PHP is not installed. When I try to load a php page it does not load properly.
Example: http://urbanturtles.servegame.com/ (My Site)
At first I thought the php module was simply not loaded but when I try to run sudo a2enmod php
but it did not work and I get this error:ERROR: Module php does not exist!
Thanks for help in advance!
EDIT
After trying to load a simple PHP page to show the php version I have gotten a new error trying to load the page. that error is visible here: http://urbanturtles.servegame.com/version.php . This makes me think I have more of an Apache issue than a php issue. I have a main Apahce sever that proxys all incoming traffic to each server inside my network. The Apache config for the main server looks like this:
<VirtualHost *:*>
ServerName MaxKulik.net
ServerAdmin max@maxkulik.net
ProxyPreserveHost On
ServerName "www.MaxKulik.net"
ServerAlias "MaxKulik.net"
ProxyPass / http://192.168.1.5/
ProxyPassReverse / http://192.168.1.5/
ErrorLog $APACHE_LOG_DIR/error.log
CustomLog $APACHE_LOG_DIR/access.log combined
</VirtualHost>
<VirtualHost *:*>
ServerName MaxKulik.net
ServerAdmin max@maxkulik.net
ProxyPreserveHost On
ServerName "www.MaxKulik.net"
ServerAlias "MaxKulik.net"
SSLProxyEngine On
SSLProxyCheckPeerCN on
SSLProxyCheckPeerExpire on
ProxyPass / https://192.168.1.5/
ProxyPassReverse / https://192.168.1.5.
</VirtualHost>
<VirtualHost *:*>
ServerName USI
ServerAdmin max@maxkulik.net
ProxyPreserveHost On
ServerName "www.UrbanTurtles.servegame.com"
ServerAlias "UrbanTurtles.servegame.com"
ProxyPass / http://192.168.1.28
ProxyPassReverse / http://192.168.1.28
ErrorLog $APACHE_LOG_DIR/error.log
CustomLog $APACHE_LOG_DIR/access.log combined
</VirtualHost>
This question already has an answer here:
What's the easiest way to set up a LAMP stack?
17 answers
server apache2 php
server apache2 php
edited Feb 6 at 5:40
asked Feb 6 at 4:54
Max Kulik
383318
383318
marked as duplicate by muru, Eric Carvalho, Max Kulik, David Foerster, vidarlo Feb 8 at 6:00
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by muru, Eric Carvalho, Max Kulik, David Foerster, vidarlo Feb 8 at 6:00
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
I added some info to the post. This is not a duplicate question.
â Max Kulik
Feb 6 at 5:41
Why is it not a duplicate?
â muru
Feb 6 at 5:42
1
@muru because it's not a problem with php. see OP's comment below my answer
â Vishwa
Feb 6 at 5:42
1
@Vishwa I see both a problem with PHP (the link in the question) and a problem with whatever proxypass is being used (the link in the comment).
â muru
Feb 6 at 5:44
1
Is the final.
inhttps://192.168.1.5.
a typo or intentional?
â muru
Feb 6 at 5:45
 |Â
show 1 more comment
I added some info to the post. This is not a duplicate question.
â Max Kulik
Feb 6 at 5:41
Why is it not a duplicate?
â muru
Feb 6 at 5:42
1
@muru because it's not a problem with php. see OP's comment below my answer
â Vishwa
Feb 6 at 5:42
1
@Vishwa I see both a problem with PHP (the link in the question) and a problem with whatever proxypass is being used (the link in the comment).
â muru
Feb 6 at 5:44
1
Is the final.
inhttps://192.168.1.5.
a typo or intentional?
â muru
Feb 6 at 5:45
I added some info to the post. This is not a duplicate question.
â Max Kulik
Feb 6 at 5:41
I added some info to the post. This is not a duplicate question.
â Max Kulik
Feb 6 at 5:41
Why is it not a duplicate?
â muru
Feb 6 at 5:42
Why is it not a duplicate?
â muru
Feb 6 at 5:42
1
1
@muru because it's not a problem with php. see OP's comment below my answer
â Vishwa
Feb 6 at 5:42
@muru because it's not a problem with php. see OP's comment below my answer
â Vishwa
Feb 6 at 5:42
1
1
@Vishwa I see both a problem with PHP (the link in the question) and a problem with whatever proxypass is being used (the link in the comment).
â muru
Feb 6 at 5:44
@Vishwa I see both a problem with PHP (the link in the question) and a problem with whatever proxypass is being used (the link in the comment).
â muru
Feb 6 at 5:44
1
1
Is the final
.
in https://192.168.1.5.
a typo or intentional?â muru
Feb 6 at 5:45
Is the final
.
in https://192.168.1.5.
a typo or intentional?â muru
Feb 6 at 5:45
 |Â
show 1 more comment
1 Answer
1
active
oldest
votes
up vote
1
down vote
from viewing your site's page source, it shows that it loaded wp-blog-header.php from your wordpress installation. if you still thinks something wrong with your php, do as follows
Create a text file, e.g. using notepad or any other text editor:
<?php
phpinfo();
?>Save the file as "version.php". Make sure, that the extension is .php (not .txt)
- Upload the file to the root of your web server
- Open the file in your web browser, e.g. http://www.yourdomain.com/version.php
or you can install xampp or lampp as it comes with everything you need bundled
I did that and it seems that my problem may lie slightly deeper. Have a look if you'd like urbanturtles.servegame.com/version.php
â Max Kulik
Feb 6 at 5:25
1
seems like you've got something wrong with server, dns and ip. not with the php . take a look at these, stackoverflow.com/questions/16643412/⦠and stackoverflow.com/questions/16526703/dns-lookup-failing Also you should try on serverfault (serverfault.com)
â Vishwa
Feb 6 at 5:41
I don't think it's a DNS issue. I added some info to the post. And thanks. I'll try there also.
â Max Kulik
Feb 6 at 5:42
1
Not a dns, but with Apache.. check on this line on your edit, ProxyPassReverse / 192.168.1.5. is final . was necessary somehow? or mistake?
â Vishwa
Feb 6 at 5:48
1
You should restart apache
â Vishwa
Feb 6 at 5:55
 |Â
show 4 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
from viewing your site's page source, it shows that it loaded wp-blog-header.php from your wordpress installation. if you still thinks something wrong with your php, do as follows
Create a text file, e.g. using notepad or any other text editor:
<?php
phpinfo();
?>Save the file as "version.php". Make sure, that the extension is .php (not .txt)
- Upload the file to the root of your web server
- Open the file in your web browser, e.g. http://www.yourdomain.com/version.php
or you can install xampp or lampp as it comes with everything you need bundled
I did that and it seems that my problem may lie slightly deeper. Have a look if you'd like urbanturtles.servegame.com/version.php
â Max Kulik
Feb 6 at 5:25
1
seems like you've got something wrong with server, dns and ip. not with the php . take a look at these, stackoverflow.com/questions/16643412/⦠and stackoverflow.com/questions/16526703/dns-lookup-failing Also you should try on serverfault (serverfault.com)
â Vishwa
Feb 6 at 5:41
I don't think it's a DNS issue. I added some info to the post. And thanks. I'll try there also.
â Max Kulik
Feb 6 at 5:42
1
Not a dns, but with Apache.. check on this line on your edit, ProxyPassReverse / 192.168.1.5. is final . was necessary somehow? or mistake?
â Vishwa
Feb 6 at 5:48
1
You should restart apache
â Vishwa
Feb 6 at 5:55
 |Â
show 4 more comments
up vote
1
down vote
from viewing your site's page source, it shows that it loaded wp-blog-header.php from your wordpress installation. if you still thinks something wrong with your php, do as follows
Create a text file, e.g. using notepad or any other text editor:
<?php
phpinfo();
?>Save the file as "version.php". Make sure, that the extension is .php (not .txt)
- Upload the file to the root of your web server
- Open the file in your web browser, e.g. http://www.yourdomain.com/version.php
or you can install xampp or lampp as it comes with everything you need bundled
I did that and it seems that my problem may lie slightly deeper. Have a look if you'd like urbanturtles.servegame.com/version.php
â Max Kulik
Feb 6 at 5:25
1
seems like you've got something wrong with server, dns and ip. not with the php . take a look at these, stackoverflow.com/questions/16643412/⦠and stackoverflow.com/questions/16526703/dns-lookup-failing Also you should try on serverfault (serverfault.com)
â Vishwa
Feb 6 at 5:41
I don't think it's a DNS issue. I added some info to the post. And thanks. I'll try there also.
â Max Kulik
Feb 6 at 5:42
1
Not a dns, but with Apache.. check on this line on your edit, ProxyPassReverse / 192.168.1.5. is final . was necessary somehow? or mistake?
â Vishwa
Feb 6 at 5:48
1
You should restart apache
â Vishwa
Feb 6 at 5:55
 |Â
show 4 more comments
up vote
1
down vote
up vote
1
down vote
from viewing your site's page source, it shows that it loaded wp-blog-header.php from your wordpress installation. if you still thinks something wrong with your php, do as follows
Create a text file, e.g. using notepad or any other text editor:
<?php
phpinfo();
?>Save the file as "version.php". Make sure, that the extension is .php (not .txt)
- Upload the file to the root of your web server
- Open the file in your web browser, e.g. http://www.yourdomain.com/version.php
or you can install xampp or lampp as it comes with everything you need bundled
from viewing your site's page source, it shows that it loaded wp-blog-header.php from your wordpress installation. if you still thinks something wrong with your php, do as follows
Create a text file, e.g. using notepad or any other text editor:
<?php
phpinfo();
?>Save the file as "version.php". Make sure, that the extension is .php (not .txt)
- Upload the file to the root of your web server
- Open the file in your web browser, e.g. http://www.yourdomain.com/version.php
or you can install xampp or lampp as it comes with everything you need bundled
answered Feb 6 at 5:21
![](https://i.stack.imgur.com/STn8U.jpg?s=32&g=1)
![](https://i.stack.imgur.com/STn8U.jpg?s=32&g=1)
Vishwa
118118
118118
I did that and it seems that my problem may lie slightly deeper. Have a look if you'd like urbanturtles.servegame.com/version.php
â Max Kulik
Feb 6 at 5:25
1
seems like you've got something wrong with server, dns and ip. not with the php . take a look at these, stackoverflow.com/questions/16643412/⦠and stackoverflow.com/questions/16526703/dns-lookup-failing Also you should try on serverfault (serverfault.com)
â Vishwa
Feb 6 at 5:41
I don't think it's a DNS issue. I added some info to the post. And thanks. I'll try there also.
â Max Kulik
Feb 6 at 5:42
1
Not a dns, but with Apache.. check on this line on your edit, ProxyPassReverse / 192.168.1.5. is final . was necessary somehow? or mistake?
â Vishwa
Feb 6 at 5:48
1
You should restart apache
â Vishwa
Feb 6 at 5:55
 |Â
show 4 more comments
I did that and it seems that my problem may lie slightly deeper. Have a look if you'd like urbanturtles.servegame.com/version.php
â Max Kulik
Feb 6 at 5:25
1
seems like you've got something wrong with server, dns and ip. not with the php . take a look at these, stackoverflow.com/questions/16643412/⦠and stackoverflow.com/questions/16526703/dns-lookup-failing Also you should try on serverfault (serverfault.com)
â Vishwa
Feb 6 at 5:41
I don't think it's a DNS issue. I added some info to the post. And thanks. I'll try there also.
â Max Kulik
Feb 6 at 5:42
1
Not a dns, but with Apache.. check on this line on your edit, ProxyPassReverse / 192.168.1.5. is final . was necessary somehow? or mistake?
â Vishwa
Feb 6 at 5:48
1
You should restart apache
â Vishwa
Feb 6 at 5:55
I did that and it seems that my problem may lie slightly deeper. Have a look if you'd like urbanturtles.servegame.com/version.php
â Max Kulik
Feb 6 at 5:25
I did that and it seems that my problem may lie slightly deeper. Have a look if you'd like urbanturtles.servegame.com/version.php
â Max Kulik
Feb 6 at 5:25
1
1
seems like you've got something wrong with server, dns and ip. not with the php . take a look at these, stackoverflow.com/questions/16643412/⦠and stackoverflow.com/questions/16526703/dns-lookup-failing Also you should try on serverfault (serverfault.com)
â Vishwa
Feb 6 at 5:41
seems like you've got something wrong with server, dns and ip. not with the php . take a look at these, stackoverflow.com/questions/16643412/⦠and stackoverflow.com/questions/16526703/dns-lookup-failing Also you should try on serverfault (serverfault.com)
â Vishwa
Feb 6 at 5:41
I don't think it's a DNS issue. I added some info to the post. And thanks. I'll try there also.
â Max Kulik
Feb 6 at 5:42
I don't think it's a DNS issue. I added some info to the post. And thanks. I'll try there also.
â Max Kulik
Feb 6 at 5:42
1
1
Not a dns, but with Apache.. check on this line on your edit, ProxyPassReverse / 192.168.1.5. is final . was necessary somehow? or mistake?
â Vishwa
Feb 6 at 5:48
Not a dns, but with Apache.. check on this line on your edit, ProxyPassReverse / 192.168.1.5. is final . was necessary somehow? or mistake?
â Vishwa
Feb 6 at 5:48
1
1
You should restart apache
â Vishwa
Feb 6 at 5:55
You should restart apache
â Vishwa
Feb 6 at 5:55
 |Â
show 4 more comments
I added some info to the post. This is not a duplicate question.
â Max Kulik
Feb 6 at 5:41
Why is it not a duplicate?
â muru
Feb 6 at 5:42
1
@muru because it's not a problem with php. see OP's comment below my answer
â Vishwa
Feb 6 at 5:42
1
@Vishwa I see both a problem with PHP (the link in the question) and a problem with whatever proxypass is being used (the link in the comment).
â muru
Feb 6 at 5:44
1
Is the final
.
inhttps://192.168.1.5.
a typo or intentional?â muru
Feb 6 at 5:45