Knowledge Base
MilesWeb / Domain Name & DNS Issues

Setting Your PHP Settings in Command Line

Approx. read time : 2 min

When you are running a PHP file from command line, there might be times when you have to roll out improvements to the PHP settings. In this guide we will demonstrate to you generally accepted methods to determine the php.ini document, and change a PHP setting in summon line. In the event that you are not working in summon line, you can change your PHP settings in cPanel.

Specify the php.ini File in Command Line

  • Connect to your server using SSH.
  • You can specify the php.ini file in command line by using the following syntax:

php -c [Path to php.ini file] [Path to .php file]

For example:

php -c /home/userna5/public_html/php.ini /home/userna5/public_html/example.php

Now the example.php file will run, with the limitations set in the php.ini file located here: /home/userna5/public_html

Related: How To Login to Your Server By SSH?

Change PHP settings

  • Connect to your server using SSH.
  • You can specify php.ini settings in command line with this syntax:

php -c [Path to php.ini file] [Path to .php file] -d [PHP setting]

For example:

php -c /home/userna5/public_html/php.ini /home/userna5/public_html/example.php -d memory_limit=256M

In this example, you can see I am setting the memory limit to 256 Megabytes. Here are some other PHP settings that are often modified:

max_execution_time

max_input_time

upload_max_filesize

Trusted By Thousands of Clients & Big Businesses

We highly appreciate the kind and stellar feedback we receive from our customers. Delivering the best is our goal! MilesWeb is rated Excellent out of 5 based on reviews. Read more reviews.

Excellent
Based on reviews
2 hours ago
Perfect and Valuable Server + ...
I am using MilesWeb Servers, The main thing which I getting are continuous support over everything w...
Gunjan Makwana
4 hours ago
Milesweb is superb Hosting pro...
Milesweb is superb Hosting provider ever, their Support team is amazing!!!...
Abhishek Singh
15 hours ago
Great support in great timing...
We need urgent assistance on changes in a primary domain on our client's Cpanel accounts and reached...
Riyaju Deen
21 hours ago
Best Website Hosting platform ...
I was new on MilesWeb. And needed help on multiple areas from setting up to getting started with cre...
Harshada
1 days ago
Very quick and helpful assista...
Very quick and helpful assistance. Support person listened properly and provided a nice solution....
Narendra
1 days ago
the team is very supportive th...
the team is very supportive though at times effort needs to be made to make understand the problem s...
Suree Sharma
1 days ago
I am using miles web for 3plus...
I am using miles web for 3plus years, very quick and perfect support by the team, they helped me man...
Sri Raghav
2 days ago
The service is good...
The service is good. They are answering with patience and doing the needful as soon as possible....
MR
2 days ago
Perfect and Valuable Server + ...
I am using MilesWeb Servers, The main thing which I getting are continuous support over everything w...
Gunjan Makwana
3 days ago
Very quick and helpful assista...
Very quick and helpful assistance. Support person listened properly and provided a nice solution....
Narendra
4 days ago
positively helped me with find...
positively helped me with finding insecure content on my website causing SSL to not work properly on...
Thaviraj Junglee
4 days ago
Exceptional support, Truly Pra...
I had opted for the basic wordpress hosting plan as I intended to experiment with various plug-ins. ...
Aseem Chandna