Setting PHP persistent environment variables in Linux environment Phpstudy integration Environment

Source: Internet
Author: User
Tags zend

On this issue, but also I met the future, consult others just know.

There are two ways to set environment variables in Linux (as I know), one is temporary, there is no environment variable after exiting, and the other is the permanent environment variable, which is what I want to say.

Well, not much to say, on the code.

To test whether to add a PHP environment variable method:

As follows: input php-v show PHP command not found

[Email protected] ~]# Php-v-bash:php:command not found

1. First go to Linux to find the integration environment of the PHP file location

[[Email protected]/]# CD Phpstudy/server/php/[[email protected] php]# lsbin  do_not_delete  etc  include  lib  php  sbin  var[[email protected] php]# CD Bin/[[email protected] bin]# Lsphar  Phar.phar  PHP  php-cgi  php-config  phpize[[email protected] bin]# Pwd/phpstudy/server/php/bin

As above get to PHP bin directory location, I Linux with Phpstudy integrated environment

Then you need to go to the Linux system environment variable file to set the PHP environment variable, and similar in Windows. Files in the root directory/etc

[Email protected] ~]# CD/[[email protected]/]# vim Etc/profile

Then you start editing the environment variable's configuration file

The path to the bin directory of the found PHP is placed here to add these two lines of code;

To add additional environment variables simply locate the directory where the executable file is located, append a colon (":") to the directory, and then save and exit

Execute UPDATE environment variable command:

[Email protected]/]# Source/etc/profile

And then enter the php-v to be OK.

[Email protected]/]# php-vphp 5.4.26 (CLI) (built:sep  7 12:52:40) Copyright (c) 1997-2014 the PHP groupzend E Ngine v2.4.0, Copyright (c) 1998-2014 Zend Technologies with    Zend Guard Loader v3.3, Copyright (c) 1998-2013, by Zend Technologies

PS: The above is purely personal opinion, I hope you support more!

Setting PHP persistent environment variables in Linux environment Phpstudy integration Environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.