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.

learn more… | top users | synonyms

1
vote
1answer
297 views

Bash to Call PHP, Wait for PHP Process to finish?

Here is my bash script #!/bin/bash timestamp() { date +"%T" } pushd 'httpdocs/DIR1/DIR2'; file="Lock3.key" if [ -f "$file" ] then echo "$file found, Session is already in progress" $(date) ...
1
vote
0answers
15 views

Apache2 uncaught Exception 500 error

I have installed Apache2 on my Debian server with PHP and MariaDB. I use PDO to connect to my MariaDB database. But whenever I get an exception but don't try-catch it, I get an 500 server error. Is ...
1
vote
0answers
34 views

Setup vhost for subdomain

I am new to Linux and vhost, so I am sorry in advance if this question is stupid :D. I am trying to make vhost, but it is kinda semi working. I am able to run the index.php and load home page, but ...
0
votes
0answers
37 views

Workaround for running privileged commands from www-data user

I would like to append a string to a file located in /tmp/ from a php script. The command I would like to execute is: sudo sed -e 's/$/,yes/' -i /tmp/a.csv The Problem I can't run a sudo command ...
0
votes
0answers
210 views

Apache2 uses wrong php version even tho it isn't installed

I am having a strange problem with PHP on a raspberry Pi lately. It occurred as i tried to run the "password_hash" function and wonderd why it didn't work. The script didn't even throw an error or ...
0
votes
1answer
122 views

Install php-pecl-memcached

I'm trying to install php-pecl-memcached in php v5.4.45 and Centos v6.5. My command is following. yum --enablerepo=remi install php-pecl-memcached However I encountered the following error. ...
1
vote
0answers
67 views

How to use wget to process a html file before downloading a file [closed]

I'm trying to write a bash script to download a certain file. In order to download the file, you need to be logged in, first to access he file, secondly because the file is generated with you ...
1
vote
1answer
71 views

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 ...
2
votes
1answer
95 views

Expect PECL for PHP 7

I just upgraded to PHP 7.0.3, but there is no support for expect. Does anyone know if is it possible to bypass the installation issue? It says: root@portal:/home# pecl install expect-0.3.3.tgz pecl/...
0
votes
1answer
457 views

php ./configure error: DBA: Could not find necessary header file(s)

I have a Centos 7 machine. I decided to install apache, mysql, and php from source. I already installed (from source) the apache & mysql packages (requirements: with apr (source), apr-util (...
2
votes
1answer
34 views

Which PHP ini file

When I execute the bash command php --ini to find the location of the php.ini file, the loaded one is: Loaded Configuration File: /etc/php5/cli/php.ini But when I run a php.info on my ...
0
votes
2answers
178 views

PECL - Installing PThreads offline

I am not familiar with pecl command but is it possible to convert the command below to an offline version? pecl install channel://pecl.php.net/pthreads-0.0.44 I want to install PThreads on CentOS 6....
0
votes
2answers
97 views

Run this PHP file via Cron Job

Here is the script: <?php //Create back files? define('CREATE_BACKUPS', FALSE); if (!is_dir($argv[1])) { echo "You must enter a valid path such as /home/apresv/public_html or apresv/...
1
vote
1answer
70 views

How do I upgrade PHP on CentOS 6.7 for CiviCRM 4.7 / WordPress?

Is there any kind of "official" repo for upgrading PHP beyond the stock PHP 5.3.3 found in CentOS 6.7? I'm trying to utilize the SCL repo's, but finding all sorts of peculiarities that seem to point ...
0
votes
1answer
83 views

Exceeding memory issues on server using PHP

PHP has memory limits set at a global level in the PHP.ini file. I also know that they can be configured at the local level. Our memory limit for a query is set to 132MB, but we keeping getting ...
0
votes
2answers
51 views

Using Screens with a PHP Script

I found an external developer to make me a PHP script to 'snipe' Mineraft usernames. In order for it to operate, I have to start the script from the command line using this: php -f sniper.php > ...
0
votes
3answers
175 views

Debian 7.0 failed to install package php5-dev

While trying to install in debian, shows libssl-dev dependency needed apt-get install php5-dev Reading package lists... Done Building dependency tree Reading state information... Done Some ...
1
vote
0answers
274 views

Permissions on nginx log files

I have a PHP/nginx environment on OS X which is deployed to an Ubuntu server. On OS X, nginx is set up with Homebrew, thus my user ("joe") owns the files, whereas on Ubuntu nginx is installed with ...
0
votes
0answers
176 views

Unable to upgrade PHP 5.3.3 to 5.6 on centOS 6.3

I got a problem with upgrading PHP 5.3.3 to 5.6 on linux centOS 6.3. I've already search it on the net and got answers including here (Since it's a classic problem), but still not able to solve it. I ...
0
votes
0answers
70 views

Process being stopped randomly

I made a script to manage a TS3 server. The script runs 'cd '.$ts3location.';/bin/bash '.$ts3script.' status' where $ts3location is the full directory to the server and $ts3script is ...
2
votes
2answers
2k views

How to install php7 modules in archlinux?

I have the following php version installed: PHP 7.0.2 (cli) (built: Jan 6 2016 11:50:59) ( NTS ) Copyright (c) 1997-2015 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies ...
0
votes
1answer
1k views

Installing oci8 php extension

On a CentOS 7 server, I have installed PHP from remi repository. I need to connect to Oracle 9.2 on a remote machine. Installing oci8 via yum install oci8 results OCI8 Version 2.1.0 which is not ...
2
votes
2answers
67 views

Restarting httpd kills scripts executed from PHP

My game server has a custom PHP administration interface, which can run the server manually by running the start shell script with exec and sudo -E. However, if I restart httpd using service httpd ...
1
vote
1answer
55 views

How to Load data to one table from Multiple excel files?

I have to load data from multiple excel file into one table , Please help me to achieve the solution. We are getting excel file from different retail shop which contain multiple column , each file is ...
0
votes
2answers
223 views

How to remove a script tag from a text file with sed

I have a number of header.php files that have a malicious script tag contained within them (don't ask). I've written a not-so-elegant shell script to replace these with blank space. I had initially ...
1
vote
2answers
81 views

Complex sed Command with AND/OR/NOT

I have a bunch of php files which have many select commands. In each query i want to insert a coloumn variable admin_id = '$admin_id' i.e. if the query is select * from users where abc='xyz' and qwe='...
0
votes
0answers
292 views

PHP5.6.x on CentOS 6 with extensions

I have installed Bright Game Panel on my CentOS 6 x64 VPS. However, there is an issue when it comes to fulfilling the software's requirements. It requires three additional PHP extensions, MBSTRING ...
3
votes
2answers
900 views

PHP app crashes: child pid exits with Illegal instruction (4)

I have a CentOS 6 server with Apache and PHP. I run some application and can constantly reproduce this crash. After some sequential action the app dies and the only trace I found is the following ...
4
votes
1answer
2k views

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 ...
1
vote
2answers
490 views

How to install lampp (php7) on Manjaro?

I Tried following this guide, didn't work and it's the only guide I can find. I have php7-apache, apache, php7, mariadb, php7-mcrypt, all installed, either through pacman or yaourt, all have their ...
5
votes
2answers
6k views

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 ...
0
votes
0answers
99 views

PHP-FPM Permission denied on folders

I get read/write errors on a new CentOS + Nginx + PHP-FPM server, this is muy configuration Nginx user nginx; [...] fastcgi_pass 127.0.0.1:9000; PHP-FPM user = nginx group = nginx listen = 127....
0
votes
0answers
321 views

How to install laravel on xampp?

I'm using the latest version of manjaro 64 bit and latest version of xampp. I want to install composer and laravel; I tried many solutions on stackoverflow and askubuntu. Every time I see a different ...
0
votes
0answers
333 views

nginx + php-fpm error: failed to ptrace(PEEKDATA) pid: Input/output error

I'm seeing a few of errors like the one below in the php-fpm-error.log. We're running a Fedora setup with nginx and php-fpm and I'm just wondering what it means. Any ideas? ERROR: failed to ptrace(...
0
votes
1answer
104 views

Running SSH command from PHP gives sudo: no tty present and no askpass program specified error even though NOPASSWD settings are done

I am using LAMPP to run apache server. From a php file I am executing a python script which executes ssh, scp commands. But I am getting error: sudo: no tty present and no askpass program specified ...
2
votes
0answers
51 views

Fatal error: Call to undefined function gzopen() in /etc/apache2/htdocs/sites/all/modules/smart_ip/includes/smart_ip.utility.inc on line 454

I'm using centos 6.7, http 2.4.17, mysql 5.1, php 5.5.30. web page is working fine but at bottom it is giving below error. Fatal error: Call to undefined function gzopen() in /etc/apache2/htdocs/...
1
vote
3answers
171 views

How to add tag for xml from file exist using shell linux

xml1.xml <app> <bbb> <jjj>test1</jjj> </bbb> <bbb> <jjj>test2</jjj> </bbb> </app> xml2.xml file2 ...
1
vote
1answer
42 views

Nginx redirects all domains to one website

I'm trying to setup a server with Nginx and PHP FPM and I ran into some trouble. I've set up an Nginx virtual host and a fpm pool for each website. The problem is that all domains are showing the ...
1
vote
1answer
471 views

shell_exec cannot create file

I'm using nginx webserver and I'm writing a script that includes file creation but www-data is not able to create the file even I give permission in the sudoers list. Inside my sudoers file: www-...
0
votes
0answers
38 views

Enable modules in PHP 5 without recompiling

I am trying to install a CMS which requires the mbstring module for PHP. According to that page, the module is installed but not activated by default. The article links to an install page which "...
1
vote
1answer
241 views

Need to grab IP of visitors from the Apache logs

I want to store the IP of the visitors to my website, and I want to use PHP. Should I use cron for it or how will be the visitors' IP will be automatically stored?
1
vote
1answer
116 views

ffmpeg output.mp4 with size 0

I have a video upload script in php where i exec the following command exec("/usr/bin/ffmpeg -i ".$folder."/".$filenameIn.".mp4 ".$folder."/".$filenameOut.".flv 2>&1", $output); and the ...
0
votes
0answers
45 views

Error Output From HHVM Under Nginx

I have a web-server that I've set up with nginx with HHVM for handling PHP, and everything's working great except for one minor gripe; the location of PHP errors. When I was using PHP-FPM, errors ...
2
votes
1answer
480 views

How to read variables from a php file in bash

How do I export variables from a PHP script in Bash? I'm writing a Bash script to read database names from config.php files of each website, and then import the database from the backup repository. I ...
0
votes
1answer
36 views

Execute a php file x amount of times one after another

If I execute a php file like such: php phpfiletoexecute.php It will run 1 time. What I would like to do, is run the php file example 5 times one after another (1st completes, 2nd run starts, 3rd, ...
0
votes
1answer
330 views

Fedora 23 Apache and PHP not working

I am struggling to get an answer to this. I have Fedora 23 install, in place upgrade from Fedora 22. When I go to http://localhost I get a list of files and folder and not the Fedora Test Page as it ...
1
vote
1answer
137 views

How to update apache, mysql, phpmyadmin and php on Raspbian?

I have my own web server running on my raspberry pi, and all my programs are outdated. I would like to update my PHP, Apache, MySQL, and phpMyAdmin. Can anyone tell me how to update all of these? I'm ...
0
votes
2answers
23 views

file globbing in bash not being picked up by php -l

I am trying to run php's lint function on all files in a directory, and it's proving to be harder than I expected. (I know there are non-php files here; I'm not concerned about that right now.) Here's ...
0
votes
1answer
72 views

bash PHP versus Plesk domain installed PHP

I have configured my domain to use PHP 5.5.30 ... but when I SSH into the server, bash is telling me that the php -v is 5.4.13 Why does bash use a different version of PHP, even though when running ....
-1
votes
1answer
193 views

imagettftext(): Could not find/open font in /usr/share/pear/Image/Canvas/GD.php

I’m using this tutorial http://www.phpbuilder.com/columns/ian_gilfillan20060503.php3?page=2 But when I try and use a font I see the following in http error log and no font is displayed. From /var/...