728x90 ⚙️백엔드47 PHP - shell_exec 함수로 파이썬 실행하고 한글이 안나오는 경우 putenv('PYTHONIOENCODING=utf-8'); 추가 putenv('PYTHONIOENCODING=utf-8'); $data = shell_exec('python3 app.py'); or $data = shell_exec('PYTHONIOENCODING=utf-8 python3 app.py'); 출처: https://trytoso.tistory.com/1543 php exec 사용하여 파이썬 호출후 한글이 안나올때 제목 그대로 아래와 같이 php 에서 파이썬 파일을 호출한다. 하지만 아래와 같은 오류가 계속 발생 Traceback (most recent call last): File "/home/naya/easyOCR-binary-centos-main/tests/php_client.py", .. 2023. 2. 18. 아파치 - 포트 변경하기 sudo vim etc/apache2/ports.conf Listen 80 부분을 수정합니다. 2023. 2. 8. 아파치 - 아파치 서버 정보(버전, OS 정보, 아이피 숨기기) Simple: sudo nano /etc/apache2/conf-enabled/security.conf Then: change ServerTokens OS to ServerTokens Prod change ServerSignature On to ServerSignature Off Restart Apache : sudo service apache2 restart ServerTokens Prod[uctOnly] # 웹서버 종류만 ServerTokens Min[imal] # 웹서버 종류 및 최소 정보 ServerTokens OS # 웹서버 종류 및 OS 정보 ServerTokens Full # 웹서버 종류, OS 정보 및 설치된 모듈 정보 ServerSignature Off # 웹 서버 시그니처 정보(이메일,.. 2023. 2. 6. 아파치 - 아파치 디렉토리 리스팅 방지하기 설정 파일 경로 sudo vim /etc/apache2/apache2.conf (Options 지시자에 Indexes를 제거) Options FollowSymLinks AllowOverride None Require all granted 서비스 재시작 sudo service apache2 restart 결과 2023. 2. 6. MySQL - DBMS 계정 생성하기 외부에서 접속하기 주의 사항 실제 운영에서는 외부에서 DBMS에 접속하는 것을 매우 엄격하게 금하고 있으며 아래서 서술한 외부 접근 허용 기능들은 개인적인 목적(공부 혹은 토이 프로젝트)에서만 사용할 것을 권한다. 계정 생성 CREATE user '계정아이디'@'%' identified by '비밀번호'; localhost : 로컬 호스트에서 접속 % : 원격 호스트에서 접속(로컬 호스트를 포함하지 않음) 모든 권한(SELECT, INSERT, UPDATE, DELETE, CREATE, DROP 등) 부여 GRANT all privileges on *.* TO '계정아이디'@localhost; /etc/mysql/mysql.conf.d/mysqld.cnf 설정 파일 수정 sudo nano /etc/mysql/mysql.c.. 2022. 12. 5. MySQL - 계정들 확인하는 명령어 SELECT Host,User,plugin,authentication_string FROM mysql.user; 2022. 12. 5. npm - 구글 번역기 모듈(translate-google) npm https://www.npmjs.com/package/translate-google translate-google A free and unlimited for Google Translate, Multi-translation support object input. Latest version: 1.5.0, last published: a year ago. Start using translate-google in your project by running `npm i translate-google`. There are 13 other projects in the npm r www.npmjs.com 설치 npm i translate-google 예제 const translate = require('tra.. 2022. 11. 7. 백엔드 - Node.js(Express), React 웹 사이트 배포 사이트(Heroku) https://www.heroku.com/ Cloud Application Platform | Heroku Heroku is a platform as a service (PaaS) that enables developers to build, run, and operate applications entirely in the cloud. www.heroku.com 2022. 10. 15. 라이믹스 - 게시판 이동 시에 404 Not Found 해결 라이믹스를 막 세팅을 마치고 내비게이션 바에서 어떤 게시판으로 이동할 경우 페이지를 찾을 수 없다는 404 Not Found가 나오게 되는데 이는 서버 엔진(Apache, nginx)의 rewrite 기능이 잘 작동하지 않아서 생기는 문제 방법 1. 짧은 주소 사용하지 않음 설정 매뉴얼대로 rewrite 설정을 하거나, 설정 - 시스템 설정 - 고급 설정 - 짧은 주소 사용을 "사용하지 않음"으로 선택해주면 일단은 해결 주소 부분을 잘 보면 index.php?mid={메뉴 ID} 형식으로 변경이 된다. (권장) 방법 2. apache2.conf에서 AllowOverride 수정 아파치일 경우엔 아래 명령어로 설정 파일을 편집기로 열어서 vim /etc/apache2/apache2.conf Options .. 2022. 9. 14. MySQL - 계정 생성 / DB 생성 권한 부여 계정 생성 create user '계정아이디'@localhost identified by '비밀번호'; 2022. 9. 14. MySQL - root 계정 비밀번호 초기화 명령어 sudo mysql -uroot -p 우선 수퍼 유저 권한으로 root 로그인 ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword'; 출처: https://phoenixnap.com/kb/how-to-reset-mysql-root-password-windows-linux How to Change MySQL Root Password in Linux or Windows Learn How to Reset or Change MySQL Root Password in Linux or Windows. Forget the root userpassword for your MySQL database? Get started with this easy tutorial!.. 2022. 9. 9. PHP - 캡챠(Captcha) 구현 https://beautifulhill.tistory.com/m/4 PHP 만으로 간단한 CAPTCHA 이미지를 만들어보자 CAPTCHA((Completely Automated Public Turing test to tell Computers and Humans Apart)는 사용자가 실제 사람인지 컴퓨터 프로그램인지 구분하기 위해 사용되는 기술로 주로 회원가입이나 결제 시에 보게.. beautifulhill.tistory.com 2022. 8. 7. 이전 1 2 3 4 다음 728x90