T
T
Type Programmer2018-03-09 11:00:34
PHP
Type Programmer, 2018-03-09 11:00:34

How to output text from a file?

Tell me the easiest way to display text from a file (for a beginner) (best source :D) The index.php file should output itself

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2018-03-09
@MegaCraZy6

You need to install LAMP.
What needs to be done for this.
1) Install tasksel. To do this, run the command in the console sudo apt-get install tasksel
2) Run tasksel sudo tasksel. Use the cursor arrows on the keyboard to select LAMP Server and press OK . Don't touch anything else in the program window!!! After a while, LAMP Server will be installed.
3) Additionally, you need to install phpmyadmin
When finished, enter the address in the browser window http://localhost and you will be taken to the start page of your test site.
These are the initial stages. The rest is not up to you, but I still recommend doing it. Create a localhost
directory in your home directory, in this directory create www and two files - error.log and access.log . You will place your projects in the localhost/www directory.
Then copy the configuration file of your test site and rename it. Think of a name yourself.
This is done in the console.

cd /etc/apache2/sites-available
sudo cp 000-default.conf mySite.conf

Open a new file for editing, change the paths to your own, which lead to the localhost directory in your home directory.
After that do in the console
sudo service apache2 restart
sudo a2dissite 000-default
sudo a2ensite mySite

After that, in the localhost/www directory, create an index.php with the content
<?php
echo phpinfo();

and go in the browser to http://localhost
Everything, you can study the development.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question