Source Code

2021-05-13 16:09:32
Taotao
2593
Last edited by Hongyan on 2022-03-21 14:54:44
Share links
Summary : You can use source code package to install ZenTao in macOS, and configure the Apache+Mysql+PHP runtime environment for it. Try ZenTao Max free for 2 months! (Limited to 10 developer users and 20 lite users)

You can use source code package to install ZenTao in macOS, and configure the Apache+Mysql+PHP runtime environment for it.

1. ZenTao RTE 

  • Apache + PHP(5.3/5.4/5.5/5.6/7.0/7.1) + MySQL(5.5/5.6)/mariadb (Nginx is the second best)
  • pdo, pdo_mysql, json, filter, openssl, mbstring, zlib, curl, gd, iconv
  • Apache+Mysql+PHP is recommended.

2. Configure RTE

2.1 Configure Apache

2.1.1 macOS has Apache built in. All you have to do is to start it and enter your admin and password.

2.1.2 Apache command lines


sudo apachectl start // start Apache 
sudo apachectl stop // stop Apache 
sudo apachectl restart // restart Apache



2.1.3 Visit your localhost or 127.0.0.1 in your browser. If you see "It works!", Apache is started. If you don't have to change webserver or port number, skip the following part and configure PHP.

2.1.4 Webserver and port number

  • default path: /Library/WebServer/Documents/
  • default port number: 80


2.1.5 If you don't change the default settings of Apache, go to configure PHP.

It is strongly recommended that you do NOT change the default settings, and reasons are as follows.

  • Changed configuration file can be risky.
  • Changed webserver path can cause file permission issues.


2.1.6 If you have to change webserver path or port number, refer to the instruction below.

  - Back up the configuration file for Apache


sudo cp /etc/apache2/httpd.conf /etc/apache2/httpd.conf.backup


  - Open  httpd.conf and search for "DocumentRoot". Change its path and restart Apache.


 - Search "Listen 80" and change it to other port number. Then restart Apache.

2.2 Configure PHP

2.2.1 Check the version of PHP that is built in macOS and see whether it matches your ZenTao PHP version (5.3/5.4/5.5/5.6/7.0/7.1 ).


php -v


2.2.2 Open httpd.conf of Apache. Search "php" and you will have  # LoadModule php7_module libexec/apache2/libphp7.so

Remove # of it.


sudo vim /etc/apache2/httpd.conf # open httpd.conf


2.2.3 Restart Apache.

2.3 Configure MySQL

ZenTao source code package is for MySQL 5.5\5.6. We strongly suggest that you install MySQL using Homebrew.


2.3.1 Install Homebrew package manager.


/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


After it is installed, check its version o see whether it is installed without problems.

2.3.2 Install MySQL 5.6.


brew install mysql@5.6


Run the command below to add variables .



echo 'export PATH="/usr/local/opt/mysql@5.6/bin:$PATH"' >> ~/.bash_profile


Loading variables.


source ~/.bash_profile


Start MySQL.


brew services start mysql@5.6



2.3.3 After you start MySQL, you are log in anonymously. Enter mysql_secure_installation to initialize root. 


Enter current password for root (enter for none) 
Set root password? y 
New password: 
Re-enter new password: 
Remove anonymous users? y 
Disallow root login remotely? y 
Remove test database and access to it? n 
Reload privilege tables now? y


If you want to use MySQL, use brew command lines to do it.


brew services start mysql@5.6 # start MySQL 
brew services restart mysql@5.6 # restart MySQL
 brew services stop mysql@5.6 # stop MySQL


3. Install ZenTao

3.1 Download the package from ZenTao official website HERE.

3.2 Unzip the file and save it to Apache path (default path /Library/WebServer/Documents/).

Copy the decompressed files to the Apache access directory (the default path is /Library/WebServer/Documents/)



sudo cp -r ~/Downloads/zentaopms/* /Library/WebServer/Documents/


3.3 Visit ZenTao in your browser at LOCALHOST IP:PORT NUMBER/www/index.php


3.4 Run the command line below if any issues regarding file permissions.

sudo chmod -R 777 /Library/WebServer/Documents


3.5 If any issues regarding  session.save_path, follow the instructions below.


Change PHP configuration file /etc/php.ini.default and back it up, then rename it as php.ini. Open the file and search   session.save_path  = "/tmp" . Change the value of  "/tmp". It is recommended that you change the path to /Users/LOGIN USERNAME as shown below.

sudo chmod -R 777 /Users/login username



Configure MySQL and check whether Check MySQL is on.





If you see the screenshot above, ZenTao is installed.



FAQ


1. session.save_path problem during installation

Modify the PHP configuration file located at /etc/php.ini.default. After backing up the php.ini.default file, rename php.ini.default to php.ini and search for session.save_path = "/ tmp", modify the value of "/tmp", it is recommended to modify the path to /Users/zentao (the path can be customized to any real path), as shown in the figure below.


After the modification is completed, let go of the comment on this item, that is, delete the ";" symbol, execute the following command, and give the file permission.


sudo mkdir /Users/zentao
sudo chmod -R 777 /Users/zentao

Restart the Apache service and click the page refresh.


Write a Comment
Comment will be posted after it is reviewed.