Cheap Web Space, Domain Name:
Web Space With E-Mail, PHP/MySQL.

How can I run PHP scripts on the Linux command line, e.g. Nextcloud "occ"?

Question: 

Searching …

 

Unfortunately nothing found on "".

Premium support for Bitpalace web hosting customers only!

 from Belize: +49 30 32 70 18 92, Fax (in Germany) +49 30 32 70 18 91

service@bitpalast.net 

Skype: bitpalast

One moment please … your browser is loading the page.

 

 

Symptom

Some applications were not developed by the developers for shared hosting, although they can basically be used there.

One such application is Nextcloud. The developers assume that you can not only call the application in the browser, but also control it from the Linux command line with the help of maintenance scripts. Nextcloud contains e.g. a command line tool "occ" with which some maintenance tasks can be carried out. Sometimes you need "occ" to repair the Nextcloud database or to maintain indexes after a failed update.

In other cases and with other applications, too, it can be helpful to be able to execute PHP scripts on the Linux command line. Above all, users want to be able to freely choose the PHP version with which a script is executed. However, because in a shared hosting environment only one system serves all customer accounts on the same machine with the same software, this is not possible here.

 

Solution

In order to be able to execute a PHP script on the Linux command line with your desired PHP version, you take a little detour: You create an inactive “scheduled task”. This has several advantages. Not only are you free to choose the PHP version, but the web space control center also ensures that no access permissions are violated.

This is how it works (the example uses Nextcloud "occ", but the solution also applies to all other PHP scripts in your web space):

1. Log into the webspace control panel.

2. Click the “Websites & Domains” menu.

3. Click on "Scheduled Tasks" in the right column.

4. Click the "Add Task" button.

5. Remove the check mark from the "Active" selection box.

6. For the task type, select: "Run a PHP script".

7. Enter the path and name of your PHP script under "Script path". The path begins in your FTP root directory. For example, if you have a Nextcloud installation in httpdocs, you would enter "occ" to run the script:

httpdocs/occ

8. To the right of the script path, you can enter the parameters that are to be transferred to the script. For example, if you want to have a Nextcloud database repaired, you would enter

maintenance:repair

9. Select your preferred PHP version from the “Use PHP version” dropdown box. For the Nextcloud "occ" script, this must be exactly the PHP version that your Nextcloud installation uses. In "Websites & Domains" you can use the PHP icon to check which PHP version is set for your website.

How can I run PHP scripts on the Linux command line, e.g. Nextcloud "occ"? - Illustration no. 1

10. Click the "Run Now" button.

The script will run exactly as if you run it from the Linux command line, in the example above

/usr/bin/php ./httpdocs/occ maintenance:repair

The webspace control panel enters the path to the appropriate PHP version in the command for you. It also monitors the safe execution of the script and shows you feedback on the execution of the task.

Since you have set the "scheduled task" to "inactive", it will not be executed automatically at a certain time, but only when you click "Run Now". For frequently recurring tasks, you can save the PHP command lines and run them later with a click of the mouse.

 

Overview of frequently asked questions 

 

 

 


 

Additional Services

Starter Server: Affordable web server from  2.24 US$ () /month with PHP, database and many more 

Online Reservation System: Occupancy & vacancy schedule for any ressources (vehicles, sports facilities …) & guest houses, holiday apartments …  1.04 US$ () /month 

Software development: Development of database applications, programming and revision of computer programs & scripts  18.78 US$ () /hour 

 

FAQ – frequently asked questions 

 

Cuba

Austria

Kenya

Guyana

Palau

Lesotho

Antigua and Barbuda

Papua New Guinea

Paraguay

Cameroon

Argentina

Germany

Australia

Dominican Republic

Bahamas

Liberia

Barbados

Bolivia

Peru

Uganda

India

Philippines

Malawi

Botswana

Chile

Malta

Costa Rica

Puerto Rico

Ireland

Marshall Islands

Rwanda

Saint Kitts and Nevis

Saint Vincent and the Grenadines

Saint Lucia

Mauritius

Zambia

Samoa

Jordan

Mexico

Switzerland

Dominican Republic

Madagascar

Seychelles

Micronesia, Federated States of

Kiribati

Ecuador

Namibia

Sierra Leone

Nauru

El Salvador

Singapore

Fiji

Gambia

Solomon Islands

Ghana

Spain

New Zealand

Sudan

Nicaragua

Swaziland

South Africa

Nigeria

Pakistan

Tanzania, United Republic of

Colombia

Grenada

Tonga

Trinidad and Tobago

Honduras

Tuvalu

Uruguay

Panama

Venezuela

United States

Jamaica

Canada

Guatemala

Guinea

United Kingdom

Zimbabwe

 

"Cheap Web Space": Affordable web space, cheap web server, low-cost webserver, low-price web servers: fast web server / small web server (cheap web space). Web server for private homepages / small website projects.

  from Belize: +49 30 32 70 18 92 •  GmbH, Sensburger Allee 27, D-14055 Berlin (Germany)
Your purchase is tax-free, because you order from a non-EU country. © 2024  GmbH. All rights reserved. and the logo are registered trademarks of GmbH. For photo credits see imprint.

Imprint Privacy policy Sitemap