Questions tagged [php]

PHP is a widely-used, general-purpose scripting language that is especially suited for web development. Use this tag when you are dealing with a PHP script, installing PHP, or configuring a PHP installation.

Adapted from Wikipedia

PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. PHP code may be embedded into HTML code, or it can be used in combination with various web template systems, web content management system and web frameworks. PHP code is usually processed by a PHP interpreter implemented as a module in the web server or as a Common Gateway Interface (CGI) executable. The web server combines the results of the interpreted and executed PHP code, which may be any type of data, including images, with the generated web page. PHP code may also be executed with a command-line interface (CLI) and can be used to implement standalone graphical applications.

PHP's official website is: http://php.net/.

979 questions
58
votes
8 answers

Is there any command to enable/disable a php extension from command line?

Is there any command to enable/disable a php extension easily from command line? (php.ini)
Handsome Nerd
  • 2,295
  • 4
  • 20
  • 22
44
votes
2 answers

What user should apache and PHP be running as? What permissions should /var/www files have?

I just spun up an Ubuntu 11.10 box and then ran apt-get install apache2 php5 to install apache2 and PHP 5 on the box. Now it is functioning as a "web server" and it loads the "It Works!" page. Now I'm trying to tighten up security and I have the…
cwd
  • 44,479
  • 71
  • 146
  • 167
33
votes
4 answers

Unix system(“unzip archive.zip”) Extracting Zip Files Silently

How do I silently extract files, without displaying status?
Adedoyin Akande
  • 471
  • 1
  • 5
  • 10
25
votes
5 answers

Locating PHP extension folder using bash

I'm trying to build a bash script to install the Source Guardian PHP extension however the destination directory is different on every subsequent release of Ubuntu. Installing PHP5 on Ubuntu 14.04 results in the extensions being stored in…
Isometric
  • 351
  • 1
  • 3
  • 6
20
votes
6 answers

php shell_exec() permission on Linux Ubuntu

I'm developing a php application using Linux server. My problem is executing shell_exec() to call some exe file is not work(actually not exe, it's kind of linux executable file) echo shell_exec("whoami"); I got daemon echo shell_exec("ls") I got…
ngoaho91
  • 301
  • 1
  • 2
  • 4
18
votes
9 answers

How to get only the version number of PHP using shell commands?

I want to get only the version of php installed on CentOS. Output of php -v PHP 7.1.16 (cli) (built: Mar 28 2018 13:19:29) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies I tried this…
The One
  • 4,662
  • 11
  • 29
  • 35
18
votes
1 answer

php 7 install throws "Cannot load Zend OPcache - it was already loaded" error

I am using salt to provision my servers, and I just tried to upgrade to php 7 and although everything is installing correctly, anytime I run php -v or run any php anything it throw this at the head of any output: Cannot load Zend OPcache - it was…
Quantum
  • 741
  • 2
  • 10
  • 20
16
votes
3 answers

Giving PHP permission to write to files and folders

UPDATED FOR FURTHER CLARITY: According to http://expressionengine.com/user_guide/installation/installation.html, it says: For most Unix hosts the following is typical, but you may check with your host to see if more restrictive permissions can be…
oshirowanen
  • 2,571
  • 15
  • 46
  • 66
14
votes
3 answers

how to know which php extensions are installed

I need to install on a lamp server exactly the same php extensions that are installed on an old server, how do to know exactly which extensions are installed in order to install the same on the new server?
Tuyoshi Vinicius
  • 285
  • 1
  • 3
  • 7
11
votes
2 answers

Find out screen id

I want to start a program with SSH using PHP, which works fine, but now I want to kill the screen with PHP, but the only thing I know is the name of the screen. How do I find out the screen ID (automatically)?
TheWaveLad
  • 213
  • 1
  • 2
  • 6
11
votes
2 answers

Installing PHP7.0 from sid on jessie

I'd like to try PHP7.0 on Debian Jessie and am trying to install it from sid. However, php7.0 depends on php7.0-common which depends on php-common > 18 while php-common in sid is at 17. Does this mean it's simply impossible to install php7.0 from…
user37050
10
votes
2 answers

SELinux is preventing NGINX from writing via PHP-FPM

I'm using a server to write into a NFS type mount-point via NGINX using php-fpm. At the very first step, it shows me the following error: 2017/01/16 11:32:59 [error] 55463#0: *22 FastCGI sent in stderr: "PHP message: PHP Warning: mkdir():…
Parsa Samet
  • 767
  • 1
  • 7
  • 20
10
votes
4 answers

Case-insensitive file system for production server?

The initial situation looks like this: The corporate software is PHP-based. It is delivered by Apache 2 on a Windows 2003 Server. It is big. It is a legacy of rather unprofessional developers who did not mind about case sensitivity or directory…
p13n
  • 323
  • 1
  • 3
  • 10
10
votes
9 answers

How do I install a PHP CLI with a usable interactive prompt on Debian Wheezy?

When I install php5-cli on Debian Wheezy (currently testing), the interactive prompt is very unusable due to missing readline support (bug 341868). What's the easiest way to install a version linked against libreadline (for usable line editing)?
Matthew Flaschen
  • 838
  • 1
  • 8
  • 15
9
votes
1 answer

Print something in console in the same place of the previous echo, with a sort of negative echo

In bash you can cast a command named clear to clear all the screen commands. And with echo you can print whatever you want onscreen.. In my simple scripts I often have the need of print a percentage of what's being done with my commands.. So I could…
user3450548
  • 2,714
  • 11
  • 29
  • 46
1
2 3
65 66