Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Re-Installing PHP 5

Status
Not open for further replies.

ryezak

Technical User
Jul 1, 2008
256
Re-Installing PHP 5
I am a complete Nubie with Linux.
I am attempting at installing a LAMP server.
I had issues with the mysql at first. So I removed it complete then re-installed and it worked.
Now the PHP5 will not work. When I put the localhost address of my webserver in my browser with the testphp.php. It just wants to open the .php as a text file.
How do completely purge and re-install the PHP5 and get it to work with Apache2?
tks
 
Apache processes PHP using a module called mod_php. Check your Apache configuration to make sure it is enabled and for the right file extensions.

You may simply not have mod_php installed, it is often delivered in a separate package.

Annihilannic.
 
Where is the config file for apache in linux?
 
What Linux distribution are you using? In many of these sorts of questions, that's the first important piece of information required to help you solve your problems.

If you're trying Debian/Ubuntu, you should first do this:

Code:
sudo apt-get install libapache2-mod-php5

 followed by 

sudo /etc/init.d/apache2 restart

This will install the link from apache to php that allows your computer to answer the request to run the php page.

Note: apt-get is a specific package manager! Other distributions have their own package manager and this will not work.

Ben
Windows isn't the answer; it's the question. NO is the answer.
 
ok I found the config...my httpd file is blank?
 
ben, I did your suggestion and ran the :

sudo apt-get install libapache2-mod-php5

then restart apache.

When I test the testphp.php webpage it just cues to download as a text... what I am missing.
I think it might be the apache2 httpd.conf file which is completely empty?
 
I've run into this before. When you set up php with apache, you unfortunately have to do things in a really specific order. I'd try reinstalling php next.

Try

Code:
sudo aptitude reinstall php5

Then restart apache and see if that corrects it.

Just out of curiosity, did you install the server edition or the desktop edition of Ubuntu?

Ben
Windows isn't the answer; it's the question. NO is the answer.
 
desktop edition...I like the gui interface.
 
I tried that and it still is just trying to open the php file instead of running it as an extension.
the mod_php where would it be to tell it to run php extensions?
 
I am thinking wipe everything start new. Apache, PHP and Mysql.
Is there an easy way to reload ubuntu to original state?
 
OK. I got apache2, php5 and mysql working.
How do I test PHPmyadmin for manipulating the mysql?
Where is the phpmyadmin files. It is not showing up in the var/ folder. All I have in there is the it works and testphp.php files in there. Hmmm. Where would it of installed the phpmyadmin.

tks. rye the linux noob
 
PHPmyadmin installs itself elsewhere (don't remember off the top of my head) and then links itself via apache for security purposes.

You should be able to browse and get the login screen if you installed it properly.

Ben
Windows isn't the answer; it's the question. NO is the answer.
 
Any ideas on a good project to do in order to use the lamp server. I am new to Linux but want to learn.
Finally got it all working together.
Something that involves the sql database.
tks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top