When i upgrade my php version from 7.1 to 7.2 there is new folder include in
c:\laragon\bin\php
which is right. But when i edit the php.ini file and enable openssl and other extension, save it and restart than it will override by the previous php.ini. It happens to two three times. I think there is a global php.ini file. If it has then how can we override this php.ini files with other versions php.ini?
If anyone knows please describe it or give me suggestion. Thanks
I think you just installed php incorrectly in laragon, check the folder "C:\laragon\bin\php\php-7.3.21\ext" and if this folder is empty then that would mean there is no extension, even after activation it will not change the "php.ini" file. I had the same problem.
Looks like the response
I think there is a global php.ini file
..is wrong. Please change anything (extension) in the specific php directory that you will use. This is the php directory of laragon on my local, if I will use php version 8, then I change the php.ini file in "php-8.0.8-nts-Win32-vs16-x64".
Like this:
Related
I'm setting up a new web server with CentOS 7.4. My old server uses CentOS 6.
Several webpages use php include with arbitrary file extensions.
This still works:
include '../../includes/header.php';
This no longer works:
include 'nav.inc';
PHP version is -5.4.16-46.el7
There is nothing in the error_log.
Can someone help with what I need to configure in php.ini or the httpd.conf file?
Thanks
I had set short_open_tag = On in php.ini, but for some reason it was still set to off. Setting it back to On fixed the problem.
try this i hope it will help:
use php extension too like :nav.inc.php
include_once('nav.inc.php');
Check your include path in php.ini. The default is include_path = ".:/usr/share/php", first looking into the current work directory ., then further directories of shared libraries.
If you cannot or do not want to administrate the system settings, you can use the set_include_path or ini_set function from within PHP as well or a php.ini on directory basis or php_value in .htaccess.
I have installed php by XAMPP and now I want to install the Phalcon dll, I have to add it to my php.ini
I did all the Phalcon installing steps but I did not get it is not working; I even removed my php.ini content and restarted Apache but php is still working!
IS PHP able to work without php.ini?
How PHP is working without php.ini?
php.ini file is not mandatory for PHP to work. It allows you to set up certain parameters, but if there's none then PHP defaults apply.
Why my php.ini is not working?
You are most likely playing with wrong one. Run script with
<?php
phpinfo();
and then look for location of php.ini. This will be the file you need to edit.
Run this code:
<?php phpinfo(); ?>
to get full path to your php.ini file you are using
Use phpinfo() to check details and the path to php.ini:
<?php phpinfo() ?>
phpinfo():
Outputs information about PHP's configuration
Because every system is setup differently, phpinfo() is commonly used to check configuration settings and for available predefined variables on a given system.
I have installed PHP with Apache 2.2 on my Linux machine and all works fine following guide here
During the installation I had to copy the php.ini-development file into /usr/local/lib/php.ini, the question is why? Why exactly in this directory?
Default locations of the PHP configurations vary greatly by distribution. In any case, phpinfo() will allways tell you where is looks for your configurations.
So, create file with extension ".php" in your webroot and past this into it:
<?php
phpinfo();
Also, the default php.ini files contain plenty od usefull comments. Just read them and change what you need. Differences between dev and prod environments are usually only the verbosity. They show and log different ammounts of errors. Production usually shows no error at all.
(Debian and many other distributions put the PHP config into /etc/php5. This is actually the most reasonable place for configurations, but stick with what your distribution uses.)
The document you link to says this
You may edit your .ini file to set PHP options. [...]
If you instead choose php.ini-production, be certain to read the list of changes within, as they affect how PHP behaves.`
Have you tried something like
vi /usr/local/lib/php.ini
to see what's in it?
Maybe you need to read http://www.php.net/manual/en/configuration.file.php
You copied a default PHP.ini file, php.ini-development, to the standard 'php.ini' file in the location '/usr/local/lib/' the guide http://www.php.net/manual/it/install.unix.apache2.php
expected the php.ini file to be.
The php.ini file is a configuration file used by PHP when it is launched (runtime)
I have a dedicated server and I'm facing a strange issue. I found there 2 php installations and only one must be used and is correct, which is version 5.2.6, but currently, I see on phpinfo that the php.ini is being loaded isn't the right configuration. The php.ini which I need the server use is located in /opt/php-5.2.6/config/php.ini and the current in use is located in /etc/php.ini. How to turn on the php located in /opt/php-5.2.6/ ? I don't know what happened, maybe after I tried to install the xCache extension, but didn't work and in some way that installation of xCache changed where the php is loaded from.
How to make loading the php which I have in directory /opt/php-5.2.6/ ?
Thanks.
You can make your apache to point to another php.ini using .htaccess file.
I need to turn allow_url_include On. How can I do this? I have access to .htaccess as well as php.ini.
I'm using PHP version 5.2.9
I've tried adding
php_value allow_url_include On
in .htaccess and
allow_url_include = On
in php.ini.
Both files are at the root of my website.
Is there a way to use the curl/get page function as a workaround?
Are you sure you're grabbing the right php.ini file?
If you're on a linux box, you might be grabbing the wrong one. I've seen that happen in the past. If you are indeed using Linux, open the terminal and type
which httpd
which php
Then you'll know if your pointing to the right locations.
Depending on what you are trying to use as a file to include you will need to enable both url_fopen and url_include.
The relevant php documentation entry is available here:
http://www.php.net/manual/en/filesystem.configuration.php