Error 189 file does not exist

PLEASE RESOLVE THIS ISSUE Fatal error: Uncaught exception 'JonnyWPhantomJsExceptionInvalidExecutableException' with message 'File does not exist or is not executable: E:phantomjsbi...

composer.json

{
    "name": "qing/server",
    "authors": [
        {
            "name": "Raymond",
            "email": "773561801@qq.com"
        }
    ],
    "require": {
        "php": ">=7.3",
        "jonnyw/php-phantomjs": ">=4.1",
        "jakoch/phantomjs-installer": "2.1.1-p08"
    },
    "scripts": {
        "post-install-cmd": [
            "PhantomInstaller\Installer::installPhantomJS"
        ],
        "post-update-cmd": [
            "PhantomInstaller\Installer::installPhantomJS"
        ]
    },
    "config": {
        "bin-dir": "bin"
    }
}

test.php

<?php

require 'vendor/autoload.php';

use JonnyWPhantomJsClient;

$client = Client::getInstance();

// https://phantomjs.org/download.html
// https://github.com/jonnnnyw/php-phantomjs/issues/142
$client->getEngine()->setPath(dirname(__FILE__).'/bin/phantomjs/bin/phantomjs.exe');

$width  = 800;
$height = 600;
$top    = 0;
$left   = 0;

/** 
 * @see JonnyWPhantomJsHttpCaptureRequest
 **/
$request = $client->getMessageFactory()->createCaptureRequest('https://www.runoob.com', 'GET');
$request->setOutputFile('./capture/file.jpg');
$request->setViewportSize($width, $height);
$request->setCaptureDimensions($width, $height, $top, $left);

/** 
 * @see JonnyWPhantomJsHttpResponse 
 **/
$response = $client->getMessageFactory()->createResponse();

// Send the request
$client->send($request, $response);

3 / 3 / 1

Регистрация: 04.11.2013

Сообщений: 285

1

15.01.2015, 21:05. Показов 6809. Ответов 3


Собственно, сделал программу, но на строчку ругается, типа «File does not exist». Сам файл с таблицей нормально открывается, можно посмотреть данные и прочее.

Код

CLOSE ALL
SET DEFAULT TO "e:baziuch"
USE customer.dbf IN 1  ALIAS cus
USE order.dbf    IN 2  ALIAS ord
USE salesman.dbf IN 3  ALIAS smn
USE sale.dbf     IN 4  ALIAS sal
USE account.dbf  IN 5  ALIAS acnt
USE catalog.dbf  IN 6  ALIAS ctl INDEX catalog ORDER tag fam
USE autor.dbf    IN 7  ALIAS atr
USE town.dbf     IN 8  ALIAS twn
USE street.dbf   IN 9  ALIAS str
USE fam.dbf      IN 10 ALIAS fam INDEX fam     ORDER tag TAG(2)
USE im.dbf       IN 11 ALIAS im  INDEX im      ORDER tag im
USE ot.dbf       IN 12 ALIAS ot  INDEX ot      ORDER tag ot
CLEAR
PRIVATE otv
SELECT ctl
SET RELATION TO key_fam INTO fam, key_im INTO im, key_ot INTO ot
DO WHILE .t.
CLEAR
@ 10,10 say 'çàäàéòå ðåæèì ïðîñìîòðà'
 @ 12,10 prompt 'ñ íà÷àëà'
 @ 14,10 prompt 'ñ êîíöà'
 @ 16,10 prompt 'ñ çàäàííîãî íîìåðà'
 @ 18,10 prompt 'êîíåö ïðîñìîòðà'
  menu to otv
DO case
 CASE otv=1
  GO top
 CASE otv=2
  GO BOTTOM
 CASE otv=3
  input 'ââåäèòå íîìåð àâòîðà' to c_nomn
  LOCATE FOR key_book = c_nomn
  IF BOF()
   WAIT 'òàêîé çàïèñè íåò'
    LOOP
  ENDIF
 CASE otv=4
  CLEAR
  EXIT
ENDCASE
CLEAR
@ 20,1 say 'ôàìèëèÿ àâòîðà: '+' íàæìèòå enter'
@ 21,1 say 'äëÿ ïðîñìîòðà ïðåäûäóùåé çàïèñè '+' íàæìèòå PgUp'
@ 22,1 say 'äëÿ âûõîäà íàæìèòå esc'
DO WHILE NOT EOF()
 @ 8,5  say 'ôàìèëèÿ àâòîðà: ' + fam.name_fam
 @ 9,5  say 'Èìÿ àâòîðà: ' +     im.name_im
 @ 10,5 say 'Îò÷åñòâî àâòîðà: '+ ot.name_ot
 @ 11,5 say 'Íàçâàíèå êíèãè: ' + ctl.name_book
 @ 13,5 say RECNO()
 k=INKEY(0)
DO case
 CASE k=27
  CLEAR
  EXIT
 CASE k=18
  skip-1
 CASE k=13
  SKIP
ENDCASE
ENDDO
ENDDO

ругается конкретно на

Код

USE catalog.dbf  IN 6  ALIAS ctl INDEX catalog ORDER tag fam

имена совпадают.

Не по теме:

P.S. Не обращайте внимания на кракозябры)

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



2509 / 1130 / 582

Регистрация: 07.06.2014

Сообщений: 3,281

15.01.2015, 22:07

2

простите, а файлы catalog.dbf и catalog.cdx в каталоге e:baziuch точно существуют? И имена не содержат кирилицу (c а o — русские выглят так же, как английские, но, разумеется, это совершенно другие буквы!!)
Выполните команду в командной строке:

Код

DIR e:baziuch*.* > e:AllFiles.txt

и полученный файл e:AllFiles.txt запакуйте в архив и выложите сюда.

Цитата
Сообщение от Frip
Посмотреть сообщение

P.S. Не обращайте внимания на кракозябры)

ПЕРЕД тем, как копировать текст в буфер обмена, включите РУССКУЮ раскладку клавиатуры, поможет!



0



Супер-модератор

Эксперт Pascal/DelphiАвтор FAQ

32451 / 20945 / 8105

Регистрация: 22.10.2011

Сообщений: 36,213

Записей в блоге: 7

15.01.2015, 22:50

3

Цитата
Сообщение от Sergio Leone
Посмотреть сообщение

включите РУССКУЮ раскладку клавиатуры, поможет!

Если использовать тег CODE, а не QUOTE — раскладка не важна…



1



3 / 3 / 1

Регистрация: 04.11.2013

Сообщений: 285

17.01.2015, 17:42

 [ТС]

4

Sergio Leone, команду, которую вы сказали ввести не принимается, причина «command contains unrecognized phrase/keyword»



0



Ошибки Path not found и Path does not existПри работе с программами, утилитами и запуске игр пользователи могут столкнуться с появлением ошибок: «Path not found» и «Path does not exist». В этой статье рассмотрим, что это за ошибки и что делать, чтобы их исправить.

Что означают ошибки «Path not found» и «Path does not exist»

Пользователи, владеющие основами английского языка или потрудившиеся воспользоваться переводчиком без проблем поймут суть данных ошибок:

  • Path not found – с английского переводится как: «Путь не найден»;
  • Path does not exist – с английского переводится как: «Путь не существует».

Обе эти ошибки оповещают об одной и той же проблеме, а именно — о невозможности построить путь к указанному файлу. Это может быть, как исполняемый exe файл, так и вспомогательные файлы, требуемые для работы программы или игры.

«Path not found» и «Path does not exist» — что делать, если возникли ошибки

Прежде всего, стоит узнать, что это за путь и к какому файлу он ведет. Если речь идет о ярлыке, то следует зайти в его свойства из контекстного меню, которое вызывается правой кнопкой мыши при клике по ярлыку и посмотреть полный путь. Затем зайти в проводник и проследовать по указанному пути, убедившись, что он существует.

Целостность пути может быть нарушена в результате:

  • Переноса папки, например, в другую папку, на другой диск или съемный носитель;
  • Из-за изменения названия корневой директории или одной из внутренних промежуточных папок;
  • Повреждения файла, к которому происходит непосредственное обращение. Например, в результате ручного вмешательства или вследствие действий вирусных программ.

Если исключить последний пункт, то решений у данной проблемы 2:

  1. Зайти в свойства ярлыка и изменить путь к исполняемому файлу;
  2. Дать корректное соответствующее пути, указанному в свойствах ярлыка, название папок.

Что касается повреждения файла или его отсутствия, то решается данная проблема исключительно переустановкой программы. Некоторые приложения и игры предоставляют функционал для проверки целостности файлов и дают возможность их быстро восстановить без необходимости выполнять полную переустановку.


Если ошибки «Path not found» и «Path does not exist» возникают не во время запуска, а непосредственно во время работы программы, то диагностировать проблемный файл становится на порядок сложнее. Если в тексте ошибки указан путь, то нужно опять-таки по нему проследовать. Если из подсказок есть только конечный файл, к которому происходит обращение, то можно воспользоваться встроенным поиском Windows, чтобы его найти. Но это может стать весьма проблематичным, если файл был удален или переименован.


Ошибки «Path not found» и «Path does not exist» могут возникать и в программировании: при компиляции программ или их запуске. Причина аналогичная – не верное указан путь / url. И решение стандартное – сопоставить указанный путь с иерархией каталогов и сверить соответствие имен папок.

С абсолютным путем (вида: https://www.urfix.ru/content/images/index.php) проблемы возникают редко, так как ссылка будет работать корректно при указании на нее из любого файла и из любой директории.

А вот с относительными путями все сложнее (вида: /content/images/index.php), в которых не указаны корневые директории. Каждый начинающий вебмастер и программист сталкивался с подобной ошибкой. Решается элементарно: либо указывается абсолютный путь, либо – относительный, согласно иерархии каталогов.

Не нашли ответ? Тогда воспользуйтесь формой поиска:

In this python tutorial, we will discuss the File does not exist python, and also we will cover these below topics:

  • File does not exist python
  • File does not exist python read CSV
  • Python check if the file does not exist and create
  • File does not exist python exception
  • Python Check If a file exists
  • If the file does not exist python
  • Python file does not exist error
  • ioerror file does not exist python
  • Python if the file does not exists skip
  • Python raise file does not exists

Here, we can see how to check whether file exists in python.

  • In this example, I have imported a module called os.path. The os.path module is used for processing the files from different places in the system.
  • The os.path.exists is used to check the specified path exists or not.
  • The path of the file is assigned as r’C:UsersAdministrator.SHAREPOINTSKYDesktopWorkmobile.txt’. The mobile.txt is the name of the file.

Example:

import os.path
print(os.path.exists( r'C:UsersAdministrator.SHAREPOINTSKYDesktopWorkmobile.txt'))

As the file is not present so the output is returned as False. You can refer to the below screenshot for the output.

File does not exist python
File does not exist python

This is how to fix file not exist error python.

Read, Python program to print pattern.

File does not exist python read CSV

Here, we can see how check file does not exist read CSV in python.

  • In this example, I have used exceptions, So I have taken try block and to check whether the file exists or not.
  • I have opened the file with .csv extension, if condition is true it should print File present as the output.
  • If the file is not found, the except is FileNotFoundError is used. As the file is a present exception is not raised.

Example:

try:
    with open("student.csv") as f:
        print("File present")
except FileNotFoundError:
    print('File is not present')

As the file is present exception is not raised, we can see the output as File present. The below screeenshot shows the output.

file does not exist python read CSV
file does not exist python read CSV

This is how to fix error, File does not exist error in Python while reading CSV file.

Python check if file does not exists and create

Now, we can see how to check if file does not exists and create in python.

  • In this example, I have imported a module called os. The path of the file is read.
  • The if condition is used as os.path.exists(x), os.path.isfile(x).
  • If the file is present the condition returns true as the output.
  • If the file is not present then the else condition is executed and the file is created by using f = open(“pic.txt”,”w”). The pic.txt is the name of the file and “w” is the mode of the file.
  • The f.close() is used to close the file.

Example:

import os
x=r'C:UsersAdministrator.SHAREPOINTSKYphoto.txt'
if os.path.exists(x):
    if os.path.isfile(x):
        print("file is present")
else:
  print("file is not present and creating a new file")
f = open("pic.txt","w")
f.close()

As the file is not present the else condition is executed and the new file is created. You can refer to the below screenshot for the output.

Python check if file does not exists and create
Python check if file does not exists and create

This is how to check if file does not exists and create it in Python.

File does not exist python exception

Here, we can see file does not exist exception in python.

  • In this example, I have used exceptions.
  • Here, I have taken a try block to check whether the file exists or not. So I have opened the file as with open(“bottle.py”) as f if condition is true it should print(“File present”).
  • If the file is not found, the except FileNotFoundError is used. As the file is not present exception is executed.

Example:

try:
    with open("bottle.py") as f:
        print("File present")
except FileNotFoundError:
    print('File is not present')

You can refer to the below screenshot for the output.

File does not exist python exception
File does not exist python exception

Python check If a file exists

Now, we can see check if a file exists in python.

  • In this example, I have imported a module called os.path and also a path from os. The module path checks the specified path is present or not.
  • I have used a function called main as def main().
  • The path.exists() is used to check whether the specified path exists or not. as both the file are not present.
  • As only one file is present we can see that the output is true and another file 925.txt is not found so it returns false as the output.
  • Every module has an attribute called __name__., the value of the attribute is set to “__main__”.

Example:

import os.path
from os import path
def main():
   print (str(path.exists('pic.txt')))
   print (str(path.exists('925.txt')))
if __name__== "__main__":
   main()

As the file 925.txt file is not present, we can see the false is returned as the output. The below screenshot shows the output.

Python check If file exists
Python check If file exists

This is how to check if a file exists in Python or not.

If the file does not exist python

Now, we can see if the file does not exist in python.

  • In this example, I have imported a module called pathlib. The module pathlib is used to work with files and directories.
  • The pathlib.path is used to join the path of the two directories.
  • The path.exists() is used to check whether the file exists are not.
  • The path.is_file is used to find the result of the file.

Example:

import pathlib
path = pathlib.Path('laptop.txt')
path.exists()
print(path.is_file())

As the file is not present false is returned as the output. You can refer to the below screenshot for the output.

If the file does not exist python
If the file does not exist python

Python file does not exist error

Here, we can see file does not exist error in python.

In this example, I have taken a file as mobile.txt to read the file as the file does not exists so the error is found.

Example:

myfile = open("mobile.txt")
print(myfile.read())
myfile.close()

We can see FileNotFoundError as the output. You can refer to the below screenshot for the output. In order to solve the error, we have to give the file name which is present in the system.

Python file does not exist error
Python file does not exist error

IOError file does not exist python

Here, we can see IOError file does not exist in python.

  • In this example, I have used exceptions, So I have taken try block and to check whether the file exists or not.
  • I have opened the file as with open(“mobile.txt”) as f, if condition is true it should print(“File present”). The mobile.txt is the name of the file.
  • If the file is not found, the except IOError is used. As the file is not present exception is executed.

Example:

try:
    with open("mobile.txt") as f:
        print("File present")
except IOError:
  print('File is not present')

As the file is not present the except is executed. File is not present is printed in the output. You can refer to the below screenshot for the output.

IOError file does not exist python
IOError file does not exist python

Python if the file does not exists skip

  • In this example, I have used exceptions, So I have taken try block and to check whether the file exists or not.
  • I have opened the file as with open(“bike.txt”) as f, if condition is true it should print(“File present”).
  • If the file is not found, the except FileNotFoundError is used. As the file is not present exception is executed and skipped to print(‘File is not present’).

Example:

try:
    with open("bike.txt") as f:
        print("File present")
except FileNotFoundError:
    print('File is not present')

The except is executed so the output will be File is not present. You can refer to the below screenshot for the output.

Python if the file does not exists skip
Python if the file does not exists skip

Python raise file does not exist

Here, we can see how to raise file does not exist in python.

  • In this example, I have imported a module called os. The os module establishes the connection between the user and the operating system.
  • If the file is not present it should raise an error as FileNotFoundError.
  • The keyword raise is used to raise the exception.

Example:

import os
if not os.path.isfile("text.txt"):
    raise FileNotFoundError

As the file is not present an error is raised as the output. You can refer to the below screenshot for the output.

Python raise file does not exists
Python raise file does not exists

You may like the following Python tutorials:

  • How to read video frames in Python
  • Python read a file line by line example
  • Create and modify PDF file in Python
  • Python save an image to file
  • How to read a text file using Python Tkinter
  • Python program to print prime numbers

In this tutorial, we have learned about File does not exist python, and also we have covered these topics:

  • File does not exist python
  • File does not exist python read CSV
  • Python check if the file does not exist and create
  • File does not exist python exception
  • Python Check If a file exists
  • If the file does not exist python
  • IOError file does not exist python
  • Python if the file does not exists skip
  • Python raise file does not exists

Bijay Kumar MVP

Python is one of the most popular languages in the United States of America. I have been working with Python for a long time and I have expertise in working with various libraries on Tkinter, Pandas, NumPy, Turtle, Django, Matplotlib, Tensorflow, Scipy, Scikit-Learn, etc… I have experience in working with various clients in countries like United States, Canada, United Kingdom, Australia, New Zealand, etc. Check out my profile.

  • Юбилейный DevConfX пройдет 21-22 июня в Москве. Как всегда — Вы решаете, кто попадет в программу секции Backend — голосуйте за интересные доклады

  • Автор темы

    XTD

  • Дата начала

    11 Июн 2007

Статус
В этой теме нельзя размещать новые ответы.

  • #1

File does not exist, при загрузке файла…

Привет всем!

Есть такая проблема:
Когда загружаю файл стандартным способом:

Отправляю:
<FORM ACTION=»index.php» METHOD=»POST» enctype=»multipart/form-data»>
Выберите файл:<INPUT TYPE=»file» NAME=»myfile» size=»35″>
<INPUT TYPE=»submit» NAME=»submit» VALUE=»Загрузить»>
</FORM>

Принимаю:

PHP:

$myfile = $_FILES["myfile"]["tmp_name"];
$myfile_name = $_FILES["myfile"]["name"];
$myfile_size = $_FILES["myfile"]["size"];
$myfile_type = $_FILES["myfile"]["type"];
    
$uploadfile= "/home/user/public_html/file/".$_FILES["myfile"]["name"];
move_uploaded_file($_FILES["myfile"]["tmp_name"], $uploadfile);

ФАЙЛ ЗАГРУЖАЕТСЯ, вроде все нормально. Но:
(Файл *.jpg) Я потом подгоняю высоту изображения согласно ширине 180 пикс.:

PHP:

$size = @getimagesize($foto);
if ($size[0] > 180){
  if ($size[1]>$size[0]) {$procent=$size[1]/$size[0];$itsize=180*$procent;}
  elseif ($size[1]<$size[0]) {$procent=$size[0]/$size[1];$itsize=180/$procent;}
  elseif ($size[1]==$size[0]) {$itsize=180;};
  }else{
  $itsize=$size[1];
};

<img src=

PHP:

<?php echo $uploadfile; ?>

width=»180″ height=

/>

Так вот я не пойму в чем проблема? Файл загружается в папку на сервере, размер соответствует размеру на локале, а файл не отображается. Если там где должен быть рисунок нажать правой кнопкой мышки/свойства, показывается реальный путь ЮРЛ на изображение. А изображение не отображается ..
Да, изображения размером до двух мегабайт загружаются и отображаются нормально. А вот больше двух мегабайт, НЕТ.

В чем может быть проблема? Может нужно настроить php.ini? Больше выделить памяти, или еще что?

В лог на сервере пишет:
[Mon Jun 11 13:09:14 2007] [error] [client IP] File does not exist: «/home/user/public_html/file/foto.jpg

Буду благодарен за помощь..

  • #2

XTD

Да, изображения размером до двух мегабайт загружаются и отображаются нормально. А вот больше двух мегабайт, НЕТ.

Может нужно настроить php.ini? Больше выделить памяти, или еще что?

  • #3

Ты путаешь локальный путь к файлу и путь, под которым он виден через web.

Фанат


  • #4

о господи
когда же вы диск от веб-сервера отличать научитесь?
у тебя на сайте есть каталог /home/?

  • #5

Я указываю полный путь на сервере…
Да и причем тут путь? Файлы то до 2 метров нормально отображаются.

Я догадываюсь что нужно подстроить php.ini

Только ЧТО?

-~{}~ 11.06.07 16:08:

$_FILES[«myfile»][«name»] — чисто имя файла (БЕЗ ПУТИ)

  • #6

Я догадываюсь что нужно подстроить php.ini

Если догадываешься об этом, то почему не догадываешься посмотреть в мануале?

  • #7

Так что нужно делать-то? В иануале не встречал моей ошибки…

Фанат


  • #8

мля.
то у него путь неправильный, то 2 метра не хватает
когда человек сам не знает, от чего у него происходит ошибка, разговаривать с ним бесполезно.

Фанат


  • #10

http://www.php.net/manual/ru/features.file-upload.php

Фанат


  • #11

Гравицапа
судя по коду, который он привел, у него никакие файлы отображаться не должны.

пусть разберется сначала — что у него там отображается, а потом уже будем ссылки давать

Статус
В этой теме нельзя размещать новые ответы.

Методом научного тыка и такой-то матери выяснил, что /var/www/rest это глюк от объединения корня сайта по умолчанию /var/www/ и параметра запроса

GET http://site.com/rest?…….. отправляемого _курлом_ на сайт расположенный снаружи сервака

(т.е. site.com не на этой машине!!!)

Включил уровень логирования ошибок апачем

LogLevel debug

в логе появлось

[Sun Mar 17 00:27:51 2013] [error] [client 127.0.0.1] File does not exist: /var/www/rest

[Sun Mar 17 00:29:02 2013] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 0 idle, a

nd 19 total children

[Sun Mar 17 00:29:02 2013] [error] [client 127.0.0.1] File does not exist: /var/www/rest

[Sun Mar 17 00:29:03 2013] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 16 children, there are 4 idle,

and 27 total children

установил вот такие параметры

<IfModule mpm_prefork_module>

ServerLimit 400

StartServers 50

MinSpareServers 20

MaxSpareServers 40

MaxClients 350

MaxRequestsPerChild 0

</IfModule>

<IfModule mpm_worker_module>

StartServers 50

MaxClients 150

MinSpareThreads 25

MaxSpareThreads 75

ThreadsPerChild 25

MaxRequestsPerChild 0

</IfModule>

перезапустился, разумеется

Это

[error] [client 127.0.0.1] File does not exist: /var/www/rest

осталось, хотя по сугубо личным ощущениям в меньшем количестве

Есть ещё мысли что делать?

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Error 2002 webasyst
  • Error 1872 the document has no document element on line 1 перевод
  • Error 1872 hy000 slave failed to initialize relay log info structure from the repository
  • Error 186 hdc overflow mimaki
  • Error 2002 hy000 can t connect to local mysql server through socket tmp mysql sock

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии