Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
When I print out the phpinfo(), it shows my Configuration File (php.ini) Path as /usr/local/php/lib Which is correct, and where the custom ini file is located. But my Loaded Configuration File is (none). It seems like my PHP is not loading the custom ini file, although it is there where the file is looking.
I have attempted to recompile PHP, and it had no effect.
I am currently running PHP 5.2.14 on Ubuntu on Apache.
Yes, I restarted apache. I also tried to stop it and start it completely fresh.
Also a slight addition: The PHP server is running fine. I have been running this server for 6 months with no issues. It is running off of the default settings it seems, and all extensions I have compiled PHP with work, like xmlrpc and mbstring. They are shown in the PHP info.
If the Loaded Configuration File is (none), then you do not have installed PHP and Apache correctly. Try to re-install them again (in my opinion first the PHP and then the Apache). It is less time consuming than trying to change configuration. When Loaded Configuration File is (none) and PHP and Apache is working, it means that your server is using a default configuration file (default php.ini), but not your modified one.
Check the file permissions of your php.ini file. Could be that it is THERE but apache cannot access it, should be same user & group of your apache user (www-data)
Usually you can do this:
sudo chown www-data.www-data php.ini
Related
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have been using PHP 5.3.3 for awhile and have customized many things in php.ini and added some extra extensions. how i can upgrade to 5.3.8+ without leaving installed extensions and php.ini configuration?
Just make a backup of your php.ini and copy it over when you're done upgrading. As to extensions, if they're built-in extensions (or if you're using something like WAMP, XAMPP, or Zend Server that bundles the extensions you need) then you shouldn't need to do anything else, but if not then those extensions will need to be recompiled for the new version of PHP (make sure you download the latest release of the extension for PHP 5.3.x first). Many extensions can be installed using PECL, which makes things a bit easier.
There is a directory called PHPRCDocs on your disk. Set it to the version you want to have actively supported.
Also take care that the windows %PATH% environment variable point to the PHP installation you want to use by default on the system if you want to use it in command-line-interface.
If you have a webserver configured, look into your websevers documentation how you specify the path to the PHP webserver module, Fast CGI Process manager or CGI executeable. It also needs to point to that path.
Alternatively to install into a new directory you can also rename the old PHP directory and create a new directory with the same name as the previous one. PHP configuration is based on ini-file, so you can have multiple versions on the same system next to each other easily.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have a hosted website with cPanel. I want to modify php.ini, but I don't get where that file is on server. I tried to find the location of the file using phpinfo() and I got the location as /usr/local/lib/php.ini but when I search in file manager I'm unable to find this location.
I looked at https://stackoverflow.com/a/3401536/1989696 and followed the same steps, but I'm not sure how to tell if the webserver supports SSH or SFTP access.
Also, how can I locate the php.ini file?
Unless you have a dedicated or virtual server, you are not allowed to edit system-wide PHP settings.
If PHP runs as CGI, you'll possibly have a custom .ini file you can tweak:
... or, if your PHP version is 5.3 or greater, you can create your own .user.ini files.
If PHP runs as Apache module:
... you can use good old .htaccess.
And, of course, 95% of the PHP settings can just be changed from within PHP code:
ini_set()
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have installed Apache 2.0(httpd-2.0.64-win32-x86-no_ssl) and it works, then I have installed Php5.3 and it pointed to Apache configuration folder.
failed scenario:
1- create simple test.php, put in under C:\Apache\Apache2\htdocs
2- call "http://localhost:8080/test.php" --> "Bad Request..Your browser sent a request that this server could not understand."
Proposed solution by NetBeans blog (failed)
1-add those two lines to httpd.conf
AddType Application/x-httpd-php .php
LoadModule php5_module "c:/php/sapi/php5apache2_2.dll"
It doesnt works because there is no "php5apache2_2.dll" under my Php installation folder??
I have such .dll : php5ts.dll, ssleay32.dll,..
Any one have any suggestion in order to run the PHP script successfully?
It would probably be easiest to just download WAMP or a similar all-in-one web server, especially since your environment is most likely not a production environment.
Just download php5apache2_4.dll-php-5.3-win32.zip from http://www.apachelounge.com/download/
Here is a guide how to configure your apache to work with PHP 5.4
I know this is not what you asked for but why to use WAMP? First of all it's not a good idea to integrate you desktop with DEV environment (it gets messy quickly). Windows is not a natural environment for web application.
Get yourself a VMWare player (it's free) and install Ubuntu Server on it. Now you can work from Windows on your Linux server. You can also get your VMWare environment home if required.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am wondering whether I can use a php.ini file at the directory level? Specifically, I have a domain pointed to a virtual document root in a sub-directory and would like to override some php.ini values previously defined in the php.ini file located in the physical root directory.
Is this possible simply by redefining these values in a new php.ini in the sub-directory? I'm trying to stay away from defining these in .htaccess file.
In general no, but in special (CGI/FastCGI) yes: http://php.net/configuration.file.per-user
Since PHP 5.3.0, PHP includes support for .htaccess-style INI files on a per-directory basis. These files are processed only by the CGI/FastCGI SAPI. This functionality obsoletes the PECL htscanner extension. If you are using Apache, use .htaccess files for the same effect.
In addition to the main php.ini file, PHP scans for INI files in each directory, starting with the directory of the requested PHP file, and working its way up to the current document root (as set in $_SERVER['DOCUMENT_ROOT']). In case the PHP file is outside the document root, only its directory is scanned.
You can only set a limited subset of the ini-options in the user-ini-file. If you are hosting several independent sites on one server, you should consider FastCGI anyway, to keep them separated. With php5-fpm it's very easy to setup many pools of workers.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 12 years ago.
Improve this question
I don't know what to do. I read the related question on this site just like mine but those changes didn't work.
First, I edited the httpd.conf file and uncommented the PHP load module line. Next after getting this error "/usr/sbin/apachectl: line 82: ulimit: open files: cannot modify limit: Invalid argument" I changed ULIMIT_MAX_FILES="ulimit -S -n ulimit -H -n to ULIMIT_MAX_FILES="" or some odd thing. That resolved that error.
Then I finally added AddType x-httpd-php .php to the httpd.conf file because that was also mentioned in the previous question here on stackoverflow.
However I still just see my source code in Safari (actually Chrome decided to download the PHP file instead--different problem/story). Then I found a question similar to mine on this site and added some AddHandler lines to the php5.conf file which mimicked the AddType lines in the file after AddHandler. Still didn't work even after a "sudo apachectl restart".
I'm baffled. Please help. I'm just trying to get started so I can learn to program and I feel like I've spent a lifetime just trying to print 'Hello World' in my browser.
Whenever a server side script is being served as a file rather than executed as code, it means your server has not been configured properly. Make sure you have enabled the PHP module in your httpd.conf file and restarted the web server by opening preferences and toggling the "Web Sharing" option in the Sharing pane.
As a commenter noted, however, this is not a programming question but is a server administration question. Go look at the resources in serverfault.