I am new to PHP. I have successfully installed PHP on Ubuntu, now I want to start my first program. I am using gPHPEdit as an IDE. Where should I save the .php files that I create? And how to run / test them?
You should pick up a book or start following good textbooks online.If you just use php scripts, you can save them anywhere and run php on the terminal using the php command line interpreter.If you are trying to write web scripts (and I think so), you need to install and configure a web server (usually apache) and save your scripts in the server root document (usually / var / www). In addition, I highly recommend that you read a little about servers and HTTP and find out how it all works internally before learning to create sites in php.
, LAMP. sudo tasksel , enter, * amp install, - . phpmyadmin: sudo apt-get install phpmyadmin. /var/www/, http://localhost. Eclipse PDT Netbeans PHP.
LAMP
sudo tasksel
sudo apt-get install phpmyadmin
/var/www/
http://localhost
var/www/html, php- . Ubuntu 14.04. , .
sudo su
sudo subl /etc/apache2/sites-available/000-default.conf
sudo nano /etc/apache2/sites-available/000-default.conf.
DocumentRoot /var/www/html
/home/user/yoursubdir
sudo subl /etc/apache2/apache2.conf
<Directory /home/user/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory>
.
sudo service apache2 restart
127.0.1.1/directory/document.php.
Hope this helps.
delete index.html file with /var/www/
$ sudo rm index.html
create a new php file there:
$ sudo gedit /var/www/index.php
write in it:
<?php print_r(phpinfo()); ?>
Restart the Apache2 server:
$ sudo service apache2 restart
OR
$ sudo /etc/init.d/apace2 restart
and point to your localhost and /index.php
if an error occurs: http://www.allaboutlinux.eu/how-to-run-php-on-ubuntu/
Source: https://habr.com/ru/post/1796672/More articles:openid with appengine - javaSQL Server registration and summary statement - sqlPHP - access to global variables in all class functions - phpКорпоративные JavaScript Советы - javascriptHow does the Java VM allocate memory? - javaКак я могу мультиплексировать вывод в дескриптор файла ОС в Python? - pythonAndroid - send audio file using MMS - androidhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1796675/going-from-java-desktop-programming-to-android-application-developement&usg=ALkJrhiMuauKW6QCLGOkHXdsbwMzRiBdPwLimited number of active methods? - c ++Python forward declaration of functions inside classes - pythonAll Articles