How to start PHP and MySQL on Mandriva?

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
tech291083
Forum Newbie
Posts: 2
Joined: Sun Sep 25, 2005 10:23 am

How to start PHP and MySQL on Mandriva?

Post by tech291083 »

I have just installed the latest Mandriva limited edition Linux dvd (which came with a linux magazine named Linux Format) on my pc.During the installation I chose all the options including servers,office all the packeges.Since I am quite new to linux, I am not in a position to start testing php files with MySQL database connected to it as a web design practice which is part of hobby/interest. Can any one plz tell me as how to start them both.I could not find out where MySQL was installed on the system nor php and Apache server.During the installation I assumed that all three of them (PHP,MySQL and the Apache server) would be included in the installation of Mandriva limited edition.I am eager to learn PHP and MySQL on Linux.I would really apprecitate any help form the community.Thanks...
User avatar
ambivalent
Forum Contributor
Posts: 173
Joined: Thu Apr 14, 2005 8:58 pm
Location: Toronto, ON

Post by ambivalent »

Run drakconf and look at "Services" under the "System" tab. If installed correctly, httpd (Apache) and MySQL will show as running. PHP will not be in this list. To check if PHP is running, create a test file:

Code: Select all

<?php
phpinfo();
?>
and move it to the web root, usually /var/www/html. Call it via your browser at http://127.0.0.1/test.php - If nothing happens, it's broken :(
pilau
Forum Regular
Posts: 594
Joined: Sat Jul 09, 2005 10:22 am
Location: Israel

Post by pilau »

Search Google for XAMPP. It changed my life, and it will change yours.
tech291083
Forum Newbie
Posts: 2
Joined: Sun Sep 25, 2005 10:23 am

"Access denied to /var/html/www/test.php"

Post by tech291083 »

Hi ambivalent,

as u told me before, i tried to make a file with the code given by u and tried to copy it to the /var/html/www folder but when i was copying it to this folder, came a dialog box telling me that "Access denied to /var/html/www/test.php". i can not really figure out what is going on.i m sorry i m a complete idiot when it comes to linux in any form.plz help me as what to do asap.thanks.
User avatar
ambivalent
Forum Contributor
Posts: 173
Joined: Thu Apr 14, 2005 8:58 pm
Location: Toronto, ON

Post by ambivalent »

It's a permissions issue. /var/www/html is owned by root, not you as a regular "user" and the permissions are such that you can't write to the directory. You can do one of several things including: change the permissions (chmod); change the owner (chown); or only do this type of stuff as root. With respect to the first two, you also have to weigh these changes against your security needs.

You can use chmod and chown at the command line after you "su" to root.

Change permissions -

Code: Select all

chmod 666 /var/www/html  <== everybody has read/write permissions on the directory
chmod 777 /var/www/html   <== everybody has read/write/execute permissions
...etc


Change owners -

Code: Select all

chown yourUserName /var/www/html   <=== you now own the directory
chown -R yourUserName /var/www/html   <=== you now own the directory, and all subdirectories
Once again, consider your security needs - who has access and from where.

You need to find yourself a decent book, preferably specific to your distro, as you're going to have a lot of questions. As the saying goes: "You're not in Kansas anymore".

EDIT: Forgot to mention, you can find a lot of Mandriva-specific help here.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

I prefer to leave the /var/www/html as is...
And then define the virtualhosts with a documentroot in /home/userX/services/www..
Post Reply