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

0
votes
0answers
9 views

How to install old PHP version 5.2.17 package using yum?

I am trying to update php 5.2.9 to 5.2.17 as it is a bridge version to upgrade client's existing CMS. Is there a way to install this specific version using yum?
0
votes
1answer
4k views

How to install Owncloud on CentOS 6.5

I wanted to install Owncloud on my VPS running CentOS 6.5. I followed the instructions on the official owncloud website but when I run the command yum install owncloud it says Error: Package: ...
1
vote
3answers
2k views

How to do a fast convert of a .xls (MS Excel) file to .csv

How can I do a fast convert of excel to csv? I have tried with php, perl, JavaScript. but it takes too much time. For example, for a 5MB file it will take 3-5 minutes.
0
votes
0answers
149 views

Why does “Connection Failed: 2002” display randomly on my PHP/MySQL website?

I'm running CentOS 6 with Apache/PHP/MySQL. PS. I'm sort of a novice at Linux, but I did my best to gather info before coming here. I'm now a bit stuck. I recently upgraded PHP to version 5.5.12. I ...
2
votes
1answer
708 views

Error passing variable from bash to php

I have the following files: vars.txt C=1234567890 Ascript.php #!/usr/bin/php <?php var $C="$argv[1]"; echo "\n $C \n"; $con = mysql_connect('localhost','root','123') or die ("No connected"); ...
1
vote
2answers
3k views

PHP exec command has the result 0 even if an error occurs

I have this PHP code: $execout=exec('ssh root@xxx.xxx.xxx.xx "sudo /etc/init.d/smokeping reload"',$output1,$result); if($result !=0){ echo"that can't reload"; } else{ echo "successfully ...
1
vote
1answer
37 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 ...
1
vote
0answers
12 views

PHP does not use MySQL default sockets

I am having a hard time understanding why PHP cannot connect with localhost as a host. I can connect by doing: mysql -uroot -p And also, through Sequel Pro I can connect with localhost as a host. ...
-1
votes
0answers
26 views

Error while executing sh script from php [closed]

I have composer_update.sh script and everything is working as expected when I execute it from the console. When I try to execute from php I'm getting the following error: error: Your configuration ...
6
votes
5answers
11k views

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)
0
votes
2answers
811 views

How find and install PHP 5.3.10 or later on CentOS 6.5?

When I check yum list php it only shows 5.3.3 which is older than 5.3.10. How do I get and install the newer PHP? (Using CentOS 6.5)
-1
votes
0answers
11 views

Ubuntu Linux - PHP Cron doesn't work

I have a Ubuntu webserver that should execute a PHP script to cache a bunch of data every 5 minutes using a Cron job. I configured the Cron using Webmin entering the command: /usr/bin/php -q ...
0
votes
1answer
3k views

mcrypt, EPEL and CentOS 6.4

I am having issues installing php-mcrypt. I am not an administrator of any level. I have performed the following. Installed EPEL Installed REMI Configured EPEL Updated YUM Cleaned YUM Installed ...
0
votes
1answer
34 views

Data from python script to website

This involves a raspberry pi and apache2 so I thought the question would be good to go here.. have never used web sockets and things like that before so I'm pretty lost and hoping for some ...
2
votes
2answers
4k views

Git pull error libcurl.so.3 not found

I have a php script to git pull from my github repository set up in my webservice hook urls like so: <?php echo shell_exec('~/git/usr/bin/git pull 2>&1'); ?> When I open this script ...
0
votes
0answers
42 views

Installing mysqlnd for php 5.6 on CentOs 7

I get php warning: mysql_connect(): Headers and client library minor version mismatch. Headers:50547 Library:50624 Also I read that I need to install mysqlnd to my server. I tried do it using: ...
0
votes
0answers
39 views

How do I use php-fpm on RHEL 7.2?

I've already asked this on Stack Overflow but received no response, so I'm trying my luck here. I'm new to configuring Apache and I'm trying to optimize my Apache server. Reading through the ...
0
votes
1answer
1k views

PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/php_mysql.so'

I am running PHP 5.6 on Linux. When I try to load a PHP page, I'm getting the following PHP error. PHP Startup: Unable to load dynamic library /usr/lib64/php/modules/php_mysql.so' When I look ...
4
votes
1answer
1k views

suexec with chrooted environment

I'm trying to get a chrooted Apache environment working running mod_fcgid with suexec. Looking at suexec log inside jail, the wrapper scripts are being executed with no problems, however, when I look ...
4
votes
1answer
2k views

Howto fix my PHP install on FreeBSD using pkg

I've been messing around with pkg install, installing / removing both php5-5.4.29 and php55-5.5.13. But when I run php from the command line, it will give me an error like this: PHP Warning: PHP ...
1
vote
1answer
1k views

phpmyadmin doesn't work after installing php5-mysqlnd

I am currently running into some problems with phpMyAdmin. I set everything up correctly and made sure everything worked. Then later after some developing on some pages I noticed I couldn't execute ...
0
votes
0answers
23 views

NGINX and PHP Pools

We host quite a few client sites, and I've inherited a shared hosting ecosystem on DigitalOcean. We run a LEMP stack, and all sites were at the same permission access level as eachother. We are now ...
-1
votes
1answer
33 views

Where I have to move a file in order to have it not be accessible via my webserver? [closed]

I have a connection php file with my database password on it. It resides in includes directory for my paypal store on my site. Trying to work out where I can move that folder and file so no-one can ...
4
votes
5answers
37k views

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

remember checkbox value if its checked array name in a form php [migrated]

lets say we have this: echo '<form method="post"> <div class="form-group"> <table class="table table-bordered table-hover table-striped" style="width:auto"> ...
0
votes
1answer
1k views

Slow DNS resolve from curl/lynx etc

I have a strange issue with DNS resolving: Root of the problem is that I get curl errors: "Error executing HTTP request: name lookup timed out". Tried to ping some sites, all resolved fine (and fast). ...
1
vote
1answer
1k views

PECL memcached installation gets error

I installed Zend Server 6 (debian). Also installed several packages: apt-get install gcc apt-get install g++ apt-get install libncurses5-dev apt-get install zlib1g apt-get install zlib1g-dev ...
0
votes
1answer
16 views

Circular dependencies that cannot be fulfilled. PHP packages on CentOS 7 to support Drupal 8

I am trying to install Drupal 8.0.5 on Apache 2.4.6 on CentOS 7, with PHP 5.6.19. I get an error that PHP extensions are disabled. The detail I get is that it pertains to "gd." I have installed, ...
-1
votes
1answer
46 views

Unable to execute shell from web server

When ever I am trying to execute php script from web server, it fails: cat test.sh echo "Hello World" [root@yumserver ~]# I am trying to build a button on webpage through which I can push the ...
0
votes
0answers
71 views

Installing older PHP versions on Debian Jessie

I need to conduct some testing on older version of PHP, and I want to use my laptop running Debian Jessie. At the moment, I've got PHP5.6 installed on it, which I tried to delete with apt-get remove ...
0
votes
1answer
216 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 ...
1
vote
0answers
44 views

php curl script working in cli but not on crontab [closed]

I have set the following on crontab */1 * * * * /opt/php-5.3/bin/php -f /var/httpd/appliance/appliance/docs/vip_dashboard_script.php >> /tmp/vip.log 2>&1 the contents of my script. ...
1
vote
2answers
24 views

How extract under linux some capturing groups using command line in a php/preg fashion?

Given in linux environment exists lot of packages for manipulating strings (grep, awk, sed, ...), I would like a software to extract a capturing group in a php/preg like syntax. Maybe the most close ...
1
vote
0answers
23 views

php links against system libxml instead of version specified by ./configure --with-libxml-dir

I'm trying to build php-5.5.33 from source on a Debian 8 system; configure and make both run successfully, but when I run make install I get the following error: Installing PEAR environment: ...
0
votes
0answers
23 views

How to make a text file readable for only a local PHP file on server — not to everyone on web?

I have a PHP script that takes some sensitive data, hashes it, and then compares it against hashes in a text file on the server. Both the text file containing hashes and the PHP script are located in ...
0
votes
2answers
60 views

Apache shows Blank page for PHP

I've installed a fresh version of Centos 7,I'm new to Linux. I installed Apache using yum -y install httpd and i can open the test page and everything is ok with it. after that i installed ...
0
votes
1answer
62 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
2answers
121 views

httpd (apache2) server doesn't parse *.php files but displays them as text with installed php-module on arch-linux

I'm trying to set up my httpd (apache2) server on archlinux. Everything works now except for the parsing of my php files. I followed this article: ...
0
votes
0answers
14 views

Is there one-line command to update php from 5.4 to whatever higher on CentOS 7.1?

Suprisingly, this task became interesting and annoying at the same time. So, I'm asking you how to prevent such situation in future? First I tried just yum install php And it said everything is ...
1
vote
1answer
124 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) ...
0
votes
0answers
15 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
85 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
0answers
29 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 ...
1
vote
0answers
49 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 ...
0
votes
2answers
61 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 ...
1
vote
0answers
38 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 ...
2
votes
1answer
25 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 ...
7
votes
3answers
37k views

PHP 5.5.13 on CentOS 6.5 with yum

I've got problems with installing PHP 5.5.13 (last stable build) on a CentOS 6.5 (64 bit) machine, through yum. Can somebody guide me through this a little bit? It is not a part of the CentOS, EPEL ...
0
votes
2answers
54 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 ...
1
vote
1answer
53 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 ...