I have apache2 working and can run php files by navigating to localhost using chrome browser. However I'd like to be able to launch the files within the browser from the command line.  google-chrome myfile.html works but google-chrome myfile.php doesn't, even though I'm launching it from my apache root.  Any help much appreciated.
123334
As the title says: google-chrome index.phpdownloads the file immediately instead of opening it. Is there a way to change this?
7399
I've a Centos 7 with Apache, I want to compile php 7.0 and 5.6 and configure that as PHP-FPM. How can I configure Apache to allow users to change php version using .htaccess?  Example .htaccess entry:     AddHandler application/x-httpd-php7 .php
43338
I am unable to call PHP files inside the Drupal directory. My task is maintaining staff's old pages on the new platform. With pages written on clear HTML, there is no problem: I place files in a folder I created (domain.org/sites/default/files/share/staff_folder).  In sites/default/files/.htaccess I added DirectoryIndex share and now the link to the domain.org/sites/default/files/share/staff_folder/index.html can be used. When I import pages written in PHP, e.g. calling domain.org/sites/default/files/share/staff2_folder/index.php, I get a 403 error:     Forbidden      You don't have permission to access /sites/default/files/share/staff2_folder/index.php on this server.   While /sites/default/files/share/staff2_folder/index.html still works.
26468
I just installed Apache via MacPorts. It seems that my Mac was absolutely confused about which version of the Apache executables to run.  After moving the Apache executables that ship with the Mac to a directory that is not listed in the PATH variable, trying to run the httpd built by MacPorts fails even though the correct directory (/opt/local/apache2/bin) is listed in the PATH variable.  If I navigate to the directory /opt/local/apache2/bin and type the command httpd I still get the error message     -bash: httpd: command not found   If I type the command with the full path /opt/local/apache2/bin/httpd it works fine.  I've run the command alias to see if something was clashing but the only thing listed is:  alias wget='curl -O'   How do I find what is intercepting the command and preventing the executable being found in the directory, even when I'm inside the same directory?  By the way, the httpd file is executable:  -rwxr-xr-x  1 root      admin  442496  9 May  2012 httpd
116006
As it was instructed in another thread here in the forums, I opened the /usr/share/applications/mimeinfo.cache file to check for correct references. And noticed this doesn't seem to be the problem, there even are 3 optional browsers to use.  x-scheme-handler/http=google-chrome.desktop;chromium-browser.desktop;firefox.desktop; x-scheme-handler/https=google-chrome.desktop;chromium-browser.desktop;firefox.desktop;   I already checked that the programs are correctly named, using the "which" command in the terminal, like this:  $ which google-chrome $ /usr/bin/google-chrome   So google-chrome should be the first option and yet the order to open a url doesn't seem to be arriving to the program, not even to the 2nd or 3rd option for that matter anyways.  Also, the 'Get help online...' command in the 'Help' menu doesn't work. So it is not a problem with the specific document file either.  I'm running Ubuntu 12.04 LTS. If you need to ask for more relevant details, please do. It would be nice to have various opinions on how to solve this, thank you :-)  UPDATE: I ran evince from the terminal as asked. This is what I'm getting when trying to open a link:  /opt/google/chrome/google-chrome: line 42: /opt/google/chrome/chrome: Permission denied /opt/google/chrome/google-chrome: line 42: /opt/google/chrome/chrome: Success   Should I try the fix you suggested even if my error log is different?  UPDATE: Tried @maggotbrain's solution and BINGO, now I can study pdf references faster thanks to you bro!
91040
I wrote a PHP code like this  $site="http://www.google.com"; $content = file_get_content($site); echo $content;   But when I remove "http://" from $site I get the following warning:     Warning:   file_get_contents(www.google.com)   [function.file-get-contents]: failed   to open stream:   I tried try and catch but it didn't work.
26532
I'm trying to write a page that calls PHP that's stored in a MySQL database. The page that is stored in the MySQL database contains PHP (and HTML) code which I want to run on page load.  How could I go about doing this?
53822
I have a command, let say php process.php. I want to run 1000 instance of this command to test load caused on the server. How can I do this?  Things to note:   Ctrl+C should terminate all instance at once It is going to run on a single core processor so no need of advance feature like multi-threading. Nice to show current number of running instance on top Commands should output in the same terminal Commands requires no input
47586
I want to run Chrome with a given set of flags, always  I created a shortcut and added the flag to it in the following way, so my target of the shortcut says:  C:\&lt;application-path&gt;\chrome.exe --user-data-dir=D:\Chrome   But when I double click an HTML file, or if any other application triggers Chrome, it looses the flag value. The result - A new chrome window opens with Default profile directory.  I want to make the flag permanent, so that its active irrespective of however Chrome executes.  I tried changing the following registry key:  HKEY_CLASSES_ROOT\ChromeHTML\shell\open\command   It was this earlier:  "C:\&lt;application-path&gt;\chrome.exe" -- "%1"    I changed to following attempts which did not work:  1. "C:\&lt;application-path&gt;\chrome.exe" -- "%1" --user-data-dir=D:\Chrome 2. "C:\&lt;application-path&gt;\chrome.exe" -- "%1" -- "user-data-dir=D:\Chrome" 3. "C:\&lt;application-path&gt;\chrome.exe" -- "%1 user-data-dir=D:\Chrome"   Conclusively, when I try to open a link from any application, it doesn't open in my current Chrome as a new tab, rather opens a new Chrome window with no plugins and extensions since its from other directory.  Why I have changed my default directory? - because the OS drive was getting low on memory due to heave Chrome caches and apps.
96503
I have Apache running in Ubuntu 14.04. How do I disable and enable the SSL mode without a command? What about with a command?
108577
Would the following works fine without any issues? I have apc cache installed, the other packages the usual php configuration.   yum update php   would that be enough?  it is an active server, so want to make sure and see what should I take into consideration to make this less painful.
121999
I have installed Apache2 MariaDB and PHP7 for use on localhost, but PHP does not work. The Apache webside looks as normal while phpinfo.php only gives me a blank page. I used to install with 'apt-get install lamp-server^', but I wanted MariaDB, so I installed every single package including some PHP extensions and phpmyadmin. I have no idea of how to get php working. Any clues?   ~ # php -v PHP 7.0.13-0ubuntu0.16.04.1 (cli) ( NTS )   phpinfo.php:  &lt;? phpinfo(); ?&gt;
66272
I'm a web developer. When I want to start working, always i'm executing some command on terminal. For example:  sudo service apache2 start sudo service mysql start sublime   For speed up this process, I create a .sh file which contain these commands.   Now, when I want to start working, I'm just executing this .sh file and all services (mysql, apache2 etc.) starting.   Is it possible to create a custom command for this? For example if I type sudo start-working to terminal, it will execute these commands
89739
I'm running on win2003 server, PHP 526, via the cmd-line.  I have a cmdline string:  $cmd = '  "d:\Prog Files\foo.exe" -p "d:\data path\datadir"  ';     Trying to do this in php code  $out = `$cmd`;       # note use of backticks AKA shell_exec   results in a failure by foo.exe as it interprets the -p arg as "d:\data".  However, the same $cdm string copied to the windows shell cmdline executes successfully.  How do I properly handle spaces in PHP shell_exec?
110412
I'm doing a Laravel project and I need to set up a virtual host example.dev in my system. For that I've created a copy of 000-default.conf and named it as example.dev.conf and placed in /etc/apache2/sites-available. The contents of the file is given below (comments removed):  &lt;VirtualHost *:80&gt;     &lt;Directory /var/www/html/example/public/&gt;         Options Indexes FollowSymLinks MultiViews         AllowOverride All         Require all granted     &lt;/Directory&gt;      ServerName example.dev     ServerAlias www.example.dev      ServerAdmin admin@example.dev     DocumentRoot /var/www/html/example/public      ErrorLog ${APACHE_LOG_DIR}/error.log     CustomLog ${APACHE_LOG_DIR}/access.log combined &lt;/VirtualHost&gt;   Then I've enabled the site using a2ensite command and disabled 000-default.conf using a2dissite command. Then it will open my project when I try localhost (/var/www/html) in my browser and not example.dev. The virtual host example.dev always produce "The site can't be reached" error in browsers.  Any suggestions?
61963
I'm trying to execute the following command on my CentOS 6.3 x64 server:  nohup "/usr/local/bin/php -v"   The result is:  nohup: ignoring input and appending output to `nohup.out' nohup: failed to run command `/usr/local/bin/php -v': No such file or directory   This works on CentOS 5 no problem. Any idea what I'm doing wrong?
114665
When I want to execute a php file it's displayed as text in my browser.  I have a VPS at Hostinger I installed Ubuntu 18.04 with Webmin and LAMP(installed automatically).  I checked the installation see below.  apache2 - v and php -v gives me: Apache/2.4.29 and PHP 7.2.24-0ubuntu0.18.04.6  So everything seem to be installed correctly.  My default folder is /var/www/html/ I do not us short tag in my code.  I try to lunch a file called phpinfo.php with content:  &lt;?php phpinfo(); ?&gt;   And plain text appear on the page.  If the file begin with html code it's correctly rendered, even with a .php file. But the php part is not executed. e.g:  &lt;!DOCTYPE html&gt; &lt;html lang="en" dir="ltr"&gt;   &lt;head&gt;     &lt;meta charset="utf-8"&gt;     &lt;title&gt;&lt;/title&gt;   &lt;/head&gt;   &lt;body&gt;     &lt;h1&gt;Hello&lt;/h1&gt;   &lt;/body&gt; &lt;/html&gt;  &lt;?php phpinfo(); ?&gt;   Render :  Hello  But  &lt;?php phpinfo(); ?&gt;  &lt;!DOCTYPE html&gt; &lt;html lang="en" dir="ltr"&gt;   &lt;head&gt;     &lt;meta charset="utf-8"&gt;     &lt;title&gt;&lt;/title&gt;   &lt;/head&gt;   &lt;body&gt;     &lt;h1&gt;Hello&lt;/h1&gt;   &lt;/body&gt; &lt;/html&gt;   Render the code as plain text.