On my server (Redhat 7.5) I don't have internet access so I installed httpd, PHP and MySQL with its binaries.
So first I installed httpd server which installed on
/usr/local/apache2
After that, I installed PHP and MySQL which is running without any error.
I have put my PHP code in the following folder
/usr/local/apache2/htdocs
when I try to run HTML it's running properly but with PHP I try to execute PHP its show code instead of executing the code I tried to load from my PHP module in my httpd.conf file but I didn't find PHP module in my /usr/local/apache2/module folder
Please help me I am stuck with this problem.
Related
I downloaded the installer version of Xampp version 8.1.6-0 for Mac and went to the manager-osx widget to start the Apache and MySQL servers but neither would start.
I then tried using the command sudo apachectl start and then created an index.php file and put it in htdocs, and then tried to open it using http://localhost/index.php as well as http://localhost:8080/index.php and both times it said the server could not be reached.
I've actually downloaded Xamp in the past and was able to reach the server but wasn't able to get php scripts to run, but now for some reason I can't even get the server to run.
I made sure to download the installer and not the virtual machine version. I'm running Monterey version 12.4.
I tried the solutions here but they didn't seem to work. I checked my activity monitor and nothing is running on port 80.
I also installed MAMP from here and tried to start Apache but it displayed the error:
"Apache couldn't be started. Please check your MAMP installation and
configuration."
Any help would be appreciated as I just want to run PHP.
I have a system build with Laravel 5.5 and it needs PHP version 7.
I have deployed the project to site ground server, updated PHP version using PHP version but when I ran php -v command via putty it is showing me PHP version 5. I don't know what going on.
I shall be thankful if someone tell me that what is the proper way of updating PHP version?
I have also tried AddHandler application/x-httpd-php70s .php in my .htaccess files but got nothing fruitful
You can change the PHP CLI version through SSH. After connecting through SSH type cd ~ and then find .bash_profile file. Open the .bash_profile file with nano or vi which you would like to use and enter this line:
alias php=/usr/local/php72/bin/php-cli
and save the file. After that run command:
source .bash_profile
And your PHP CLI version has been changed. To confirm the PHP version type php -v and it will show you the version which you just changed.
P.S: In my case, I want to change the PHP CLI version to PHP 7.2 so I use php72 in alias php=/usr/local/php72/bin/php-cli. You can change it to any other version which you need.
So there's no problem if you see PHP5 using command line and PHP7 using php file with phpinfo();. Your hosting provider allows you to choose from several PHP version. You can select PHP7 e.g. using .htaccess but it doesn't have to change PHP CLI version. So when you set PHP7 in .htaccess file it serves your website using PHP7, but CLI is still v5.
By the way, this type of question should be asked on superuser I think.
As the topic sentence says. I'm using atom with linter-php in ubuntu with an xampp setup. PHP is located in the opt/lampp/bin folder when you've installed xampp in ubuntu 16 but atom isn't accepting it. "unable to get version" and "spawn php ENOENT." Anyone out there using this same setup? Which path did you use for the php executable? Alternatively: Should i just install php in the standard file directory outside of xampp as well and direct linter there?
This may have been a bit of a hack approach to fixing this issue but i just installed php7.0 outside of xampp again and directed the linter path there. Actually didn't have to direct it at all. As soon as i installed php from the terminal, the issue was fixed.
I am working to build a small email client inside a web application. After doing some research I attempted to use the imap function. I got an error saying I was calling an undefined function, so again I researched and uncommented extension=php_imap.dll.
I then found I had to update php with the imap function and I did so. Now, the imap functions works in php interactive inside Terminal, but I can't get it to work in the browser. I'm assuming I have to somehow load it in the Apache Config files but I can't seem to find how to do so.
Any Ideas?
You'll need to restart Apache to reload the PHP module with the new configuration. The command line PHP starts a new PHP instance each time with the latest configuration, whereas the PHP extension running in Apache is separate, and only loads new configuration setting when Apache itself is restarted.
Assuming you're running on Windows based on the .dll extension, so apachectl restart or apache2ctl restart may work, or the installer you used may have a tray app or other GUI tool that can do it for you.
If running on Linux sudo service apache2 restart or sudo service httpd restart depending on distribution.
I had php 5.3 installed with apache 2.2
I just added php 5.57 x64 with apache 2.4 x64
both setups seem to be working fine in parallel when pulling php pages through browsers
can't run php pages/scripts from command line using the new php 5.57 executable
(I cd to the directory c:\php55 then run the command: php -f c:\... path to template in htdocs)
same php pages/scripts run just fine with 5.3 php executable using same exact command
same php pages/scripts run just fine through browsers using the new php 5.57 executable (configured on port 8080)
I'm on windows 2008 r2
any idea folks?
You should use absolute path. For example
c:\php55\php.exe c:\htdosc\script.php
Also check waht php executable file is in folder c:\php55 May be it in c:\php55\bin