Apache & PHP

Ok gang…

I’m useing Ubuntu 12.04 and have Apache server as well as PHP and MYSQL.

Now when I get the FIREFOX web page by using http://127.0.1.1/info.php it shows the PHP info page.

“PHP Version 5.3.10-1ubuntu3.11”

And if I use just ‘http://127.0.1.1/’ it says… ‘It Works’.

But, how do I write PHP and point the server to the folder where the script is?

I have no idea where the folder is (or is it virtual?)

Thanks,

Deaf

Check your default vhost file in folder /etc/apache2/sites-enabled

Or just search for info.php

Maybe … var\www?

It has in the sites_enabled

VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www
<Directory />
	Options FollowSymLinks
	AllowOverride None
</Directory>
<Directory /var/www/>
	Options Indexes FollowSymLinks MultiViews
	AllowOverride None
	Order allow,deny
	allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
	AllowOverride None
	Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
	Order allow,deny
	Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

So do I just add another directory to the script so it will see where my script is?

Deaf

Either

add a new vhost file mapped to another directory

Then you must
add servername to the vhost file
Set up the server name in /etc/hosts

Or

Copy your script into /var/www

Ok I figured out in var/www the index.html file, using VI, changed to point to my project which is under var/www (as the folder 'My Project".

So now about MYSQL!!!

Ubuntu shows I have the server installed:

MySQL Server
MySQL database server (metapackage depending on the latest version)

I have the Terminal open and mysql up. But how do I feed in my script to create the databases?

Show database; comes up with

mysql> show databases;
±-------------------+
| Database |
±-------------------+
| information_schema |
| test |
±-------------------+
2 rows in set (0.00 sec)

And I have the scrip written (and residing in ‘My Project’) to load.

Thanks

Deaf

Ok got it all flying!!

Even the MySql and the databases loaded.

The problem now is while the data in the tables show up, when I try to edit or add it loses everything!

Will let you know how that works out!

Deaf

Sponsor our Newsletter | Privacy Policy | Terms of Service