For some reason my phpldapadmin doesn't want to work with my website and it says "If you are seeing this in your browser, PHP is not installed on your web server!!!" Which is not true as if the info.php file is navigated to like here it says php is enabled along with the ldap extension. The apache error log doesn't say anything about the error though.
Every other php page on my website works except phpldapadmin. I am really confused.
This is what I get when I run php -v
PHP 7.1.1-1+deb.sury.org~xenial+1 (cli) (built: Jan 20 2017 09:20:20) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.1-1+deb.sury.org~xenial+1, Copyright (c) 1999-2017, by Zend Technologies
with Xdebug v2.5.0, Copyright (c) 2002-2016, by Derick Rethans
Your webserver's document root is /var/www/html and you have to place everything within this folder (may use subfolders /var/www/html/phpmyadmin, /var/www/html/phpldapadmin, etc.). Or you can define alias for certain purposes which can point to a folder outside document root. How to config an alias: https://httpd.apache.org/docs/2.4/mod/mod_alias.html#alias
Everything else what's outside isn't accessible by webserver itself and neither can be processed by PHP.
Related
We are setting up a PHP 8 application on Web App Services, so we need to use linux.
When we run php on the console, we always get the following warning
Cannot load Zend OPcache - it was already loaded
Example:
/home/site/wwwroot# php -v
Cannot load Zend OPcache - it was already loaded
PHP 8.0.17 (cli) (built: Mar 25 2022 18:59:25) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.17, Copyright (c) Zend Technologies
with Zend OPcache v8.0.17, Copyright (c), by Zend Technologies
Any idea how to fix this?
I have an automated process to run a php script on 2 machines. It does the following:
/opt/rh/php54/root/usr/bin/php myphp.php
However, It is not running on Host 1(error: /opt/rh/php54/root/usr/bin/php: not found) but running fine on Host 2:
Host 1: Not running
PHP 7.2.9 (cli) (built: Aug 15 2018 09:19:33) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
Host 2: running fine
PHP 5.4.40 (cli) (built: Jul 22 2016 07:31:37)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
/opt/rh/php54/root/usr/bin/php--->>> This path does not exist on host 1
SELinux is disabled on both hosts.
PHP will not be installed to the path u are using. Try to use php myphp.php instead.
The path \opt/rh/php54/root/usr/bin/php does not seem to be correct. Find out the correct path for the php installation directory.
You can use which php or whereis php command.
I want to utilize PHP's get_browser() function, so I have included browscap = extras/lite_php_browscap.ini in my php.ini file.
I am running:
PHP 7.0.15 (cli) (built: Jan 17 2017 13:44:27) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.15, Copyright (c) 1999-2017, by Zend Technologies
My website still works, and get_browser() is working great... but when I go do a composer update, I am getting a big red zend_mm_heap corrupted error message.
I've tried setting opcache.fast_shutdown=0, and even turning off opcache altogether, and that doesn't fix it.
The weird thing is, I have this same setup up on my dev server, and it works fine. The only difference I can see is that I'm running PHP 7.0.18 there.
Any ideas why this is happening, and how I can try to avoid it? Thanks!
My setup was
Ubuntu 14.04
php 5.x
The website was working fine.
I upgraded the system to:
Ubuntu 16.03
php 7
When I do:
php -v
I get:
PHP 7.0.22-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.22-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies
I have:
Server version: Apache/2.4.18 (Ubuntu)
Server built: 2017-09-18T15:09:02
But, when I try to access the website, I now see a listing of the file index.php in the browser window.
Any ideas?
You should add a .htaccess file to the directory root with the line DirectoryIndex index.php index.html which tells Apache to use index.php first followed by index.html when in a directory, which is why you're seeing a directory listing of index.php
I've found that when executing php via cli php has access to custom windows system environment variables, but not when IIS runs php.
For example, I can put this in php.ini:
zend_extension="${PHP_PATH}ext\php_xdebug-2.5.5-7.1-vc14-nts.dll"
and php loads xdebug properly when called via cli:
c:\>php.exe -v
MSVC14 (Visual C++ 2015) x86 ) Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.1, Copyright (c) 1999-2017, by Zend Technologies
with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick RethansPHP 7.1.1 (cli) (built: Jan 18 2017 18:50:48) ( NTS
But Xdebug doesn't appear when I call phpinfo() on a page served by IIS. I'm assuming it's because IIS doesn't have access to the custom system variable I created. Can someone show me how to make those variables accessible in IIS, preferably in a way that I can script (whether that be via batch file, power shell or whatever) for automated deployments.
So I found that when executing setx from the command line or a batch file like:
setx PHP_PATH {path to php here}
it creates the system variable in the user space. Since IIS doesn't have access to it, php.ini variables can't be expanded. However, if you pass the /M flag, like the following:
setx /M PHP_PATH {path to php here}
this creates a variable in the global space that IIS does have access to.